Question

Asked on 2000-08-29 at 10:45:34ID: 25437618

Submitting 2 forms

by: marcoma200

Rating8.8Very Good

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_number'>
   <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" STYLE="background-color: CCCCFF; color: 330066; font-size=12">
   <option> </option>
   
<option>fluvastatin</option>
<option>lovastatin</option>
<option>omeprazole</option>

   </select>
   <br>Drugs with partially researched DOLPHIN reports <select name="partially_researched_in" STYLE="background-color: CCCCFF; color: 330066; font-size=12">
   <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_window","mypopup","width=650,height=300");return(false);><INPUT TYPE="button" VALUE="Clear" onClick="document.inputForm.other_drugs_in.value=''">
   <INPUT TYPE="submit" VALUE="Go Form 2">
   </form>
   <center>        <img src="http://www.current-patents.com/dolphin/images/gobut1.gif" width=50 height=50 border=0 align="middle">
   <br><br>

   </html>
   

Related Solutions

Solution

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.

About this Solution

View This Solution - Start Your 30 Day Free Trial
Zone
general
Tags
Participating Experts
2
Solution Grade
A

Replies

 by: mplungjan

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.

 by: mplungjan

Posted on 2000-08-29 at 11:21:15ID: 28099823

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.

 by: mplungjan

Posted on 2000-08-29 at 11:23:49ID: 28099824

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.

 by: birdchan

Posted on 2000-08-30 at 17:44:06ID: 28099825

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.

 by: marcoma

Posted on 2000-08-31 at 05:22:45ID: 28099826

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.

 by: marcoma

Posted on 2000-08-31 at 05:22:45ID: 28099827

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.

 by: mplungjan

Posted on 2000-08-31 at 06:16:03ID: 28099828

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.

 by: marcoma

Posted on 2000-08-31 at 06:49:08ID: 28099829

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.

 by: mplungjan

Posted on 2000-08-31 at 12:48:24ID: 28099830

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.

 by: marcoma

Posted on 2000-09-01 at 04:31:39ID: 28099831

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.

 by: mplungjan

Posted on 2000-09-01 at 05:03:37ID: 28099832

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.

Log In

Forgot your password?Sign up

Top Experts

  1. mplungjan

    1,840

    0 points yesterday

    Profile

BrowseAre you an Expert?