Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
I have this code which contains 2 forms (see code below). What I need is some javascript which will submit "inputForm1" if its input field is not empty. Or "inputForm2" if at least one of the input fields of that form are not empty.
The submit should take place when the image is clicked on (gobut1.gif), so I can eliminate the two submit buttons on each form.
If Fields from both forms are filled then I need an alert which askes if "inpuForm1" should be submitted (Yes/No). If "No" then ask the same of inputForm2. If "No" again then combine the data from both forms and submit to a new destination (lets call it "all_data").
Anyway, here's my page:
<html>
<title>Dolphin search screen</title>
<form name='inputForm1' action='search_patent_numb
<br>Find Patent with the number:<input type=text name=patent_number_in STYLE="background-color: CCCCFF; color: 330066; font-size=12">
<INPUT TYPE="submit" VALUE="Go Form 1">
</form>
<form name='inputForm2' action='search_drug'>
<br>Drugs with fully researched DOLPHIN reports <select name="fully_researched_in"
<option> </option>
<option>fluvastatin</optio
<option>lovastatin</option
<option>omeprazole</option
</select>
<br>Drugs with partially researched DOLPHIN reports <select name="partially_researched
<option> </option>
<option>fluoxetine</option
<option>ranitidine</option
</select>
<br><textarea name="other_drugs_in" cols=35 rows=5 wrap STYLE="background-color: CCCCFF; color: 330066; font-size=12"></textarea>
<br><INPUT TYPE="button" VALUE="List" onClick=window.open("list_
<INPUT TYPE="submit" VALUE="Go Form 2">
</form>
<center> <img src="http://www.current-pa
<br><br>
</html>
Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.
Posted on 2000-08-29 at 11:02:04ID: 28099822
All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.