473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Passing form action value to a url(Link)

58
hi all,

I am in a situation where I need a form inside another.
The nested form asks the user to scan their file,takes the posted file and sends it to a web url.The parent form submits the user input plus the scanned file.

Given that html does not allow nested forms,is it possible to turn the action value in the nested form into a link?
Expand|Select|Wrap|Line Numbers
  1. <form name="name" action=http://www.somedomain.com/ method=post 
  2.             target=some_pop_up_window encType=multipart/form-data>
Jun 24 '07 #1
3 4575
pbmods
5,821 Expert 4TB
Heya, Jankie.

Let me see if I understand what you are trying to do. So you want the User to upload a file, then fill out the rest of the form and submit the whole thing. Is that correct?

Does the script require that the file be submitted first? Or can you put everything in one form?
Jun 24 '07 #2
Jankie
58
Thank you pbmods for your response .Appreciate it everytime you are ready to share insights.
Ok,I have one form that collects usual user info plus the ability to attach a file.
User fills in form,before they reach upload section(always in the same form)they encounter a little box(what i call a nested form with its own action set to a scanning url)that offers that they scan the file before uploading it.Once scanned,they submit everything at one click(by clicking the submit button of the parent form).
The problem i cannot have 2 actions at the same time.

Parent form
<form name="parentForm" action=process.php>
<LABEL for=Upload_File>Upload File</LABEL>
<input type="hidden" name="MAX_FILE_SIZE" value="300000">
<INPUT type="file" name="userfile">
</form>

Nested form //supposing

<form name="ScanForm" action=http://www.somedomain.com/ method=post
target=some_pop_up_window encType=multipart/form-data>
<INPUT input type=file name=file size=12>
<INPUT type=image src="/scan.gif" onclick="return do_scan_file();">
</FORM>

So far, i tried combining the scan form into the parent form

Parent form
<form name="parentForm" action=process.php>
<LABEL for=Upload_File>Upload File</LABEL>
<input type="hidden" name="MAX_FILE_SIZE" value="300000">
<INPUT type="file" name="userfile">
<INPUT type=image src="/scan.gif" onclick="return do_scan_file();">
</form>

What am trying to do now is replacing the :
<INPUT type=image src="/scan.gif" onclick="return do_scan_file();">
with a simple link,that takes the selected file for scanning and send it to a web-based scanning url,without the use of a "encType=multipart/form-data" that requieres a form tag.
Jun 24 '07 #3
pbmods
5,821 Expert 4TB
Heya, Jankie.

Ok. I think I see what you're going for here. The problem is that in order to submit a form, you pretty much have to go to a new page. The other problem is that to upload a file (for security reasons) you definietely have to go to a new page.

The way I (and eBay, so it seems) do it is to either use a pop-up window or an iframe to upload the file.

You could do something like this:

Expand|Select|Wrap|Line Numbers
  1. <form action="page1.php">
  2.     <input name="fileScanned" type="hidden" value="" />
  3.     .
  4.     .
  5.     .
  6. </form>
  7.  
  8. <iframe src="filePfhorm.php"></iframe>
  9.  
filePfhorm.php would contain the 'nested' form.
Jun 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: James | last post by:
I am creating a play area inspection and re-ordering system. I have an inspection form which contains various fields including a site number field. When the user clicks a button it jumps to an...
1
by: schuderfloss | last post by:
I have a unique ID field in a table of products. And rather than store the full hyperlink/URL address I decided just to store the unique ID. I would like to have a button in a form that contains a...
1
by: Boris Condarco | last post by:
Hi gurus, Does anyone of you know how to make a URL link wihtout showing the parameters in the address text box, i would like to keep it just with the root path. Thanx a lot... Boris
2
by: Mark Towner | last post by:
Greetings, Does anyone have a solution for this problem: - I would like a PHP script to execute an action before a user clicks on a link (updating the value of a variable, for instance). Is...
4
by: Nanker | last post by:
In our .NET 1.1 ASP.NET application, I'm noticing some behavior that I would like to change. If I open a web browser and manually copy and paste a URL, then I get a new session ID (I check it by...
2
by: HackerisNewKnight | last post by:
hi all, i used to open a url link in visual c++ like this method: shell_execute("groups.google.com","open",NULL.NULL,NULL), how can i do that in csharp? could anyone help me? thanks
8
by: Abraxas | last post by:
How can I call a web service from an URL link? And the webservice redirects the user to another HTML page after it has done some actions. The redirection is no problem with this code: ...
1
by: steve2856 | last post by:
I am trying to get some code that would permit me to pass some paramaters in a URL link to certain fields on a web form. For now it would be sufficient if the URL passed firstname and lastname to...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.