Forum Moderators: open

Message Too Old, No Replies

multiple script types - passing variables?

Trying to test for a situation and react accordingly

         

Milea

5:07 am on Jan 17, 2004 (gmt 0)

10+ Year Member



Hello again. Scrapped the previous plan, and going for something similiar. I have the following bit of code, in the html file that collects the form data.
----------
<p> <b>Do you have a print to attach? <br>
Yes
<input type="radio" name="radiobuttonY" value="yes">
</b> <b>No
<input type="radio" name="radiobuttonN" value="no" checked>
</b>
-----------
the action in the form, calls submit.asp which then handles all the form data, and emails it to me. My problem is now I have to tell the .asp file what to do if the radiobuttonY value is yes.
I know I have to use an input file thing so that they can select a file to send, so this is what I have so far ...
-----------
<form enctype="multipart/form-data" method="post" action="uploadresp.asp">
<p><b>Enter filename to upload</b> (Please send prints only in acceptable graphic
formats such as .bmp, .jpg, .bmp or a .pdf file is also acceptable)<b>:</b></p>
<p>
<input type="file" name="f1">
<br>
Enter second filename if needed: <br>
<input type="file" name="f2">
<br>
<input type="submit">
</p>
</form>
-------------
But how do I get from where it checks the radiobuttonY to here for the file, and back again to attach it and send?
Somone just shoot me now please heh

korkus2000

2:56 pm on Jan 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to put the radio button in the form field of the upload. Do a javascript check to see if the value is no, if so stop the submit. Then on the serverside do the same check and process the rest of the form. If the tradio button is yes then attach it on the process page.