...

View Full Version : 2 different submit form process...



NinjaTurtle
01-03-2003, 07:57 AM
dear,

i have a drop down list, and 1 submit button.
when i onChange the drop down list, some value may changed on the same page -- called first.asp, the value are store in the Text boxes(more than 5 text boxes). But when i click on the button(named Save button), i will save all the text boxes value into database, but the Add program save into another Asp file -- called second.asp.

Example:
<Form name="form" method="post" action="first.asp" onSubmit="return checkform()">
<table width="80%" border="0" cellpadding="6" cellspacing="1" class="tabletitle" cellpading="1">
<tr>
<td><select name="Level1" onchange="document.form.submit()">
<option value="a,1" selected>-a1</option>
<option value="b,2" selected>-b2</option>
<option value="c,3" selected>-c3</option>
</select>
<input name="t1" type="text" size="15">
<input name="b2" type="text" size="15">
<input name="b3" type="text" size="15">
<input name="x2" type="text" size="15">

<input type=submit name=save value=save >
</form>

SO, how i can do is when i onChange the drop down list, the page will submit.form then get some value from database and pass to the text boxes. And when i click the Save button the values that store in the text boxes will pass to second.asp to do processing.... how?

glenngv
01-03-2003, 08:02 AM
just change the form action:

<input type="submit" name="save" value="save" onclick="this.form.action='second.asp'">

NinjaTurtle
01-03-2003, 09:38 AM
how if i have 2 functions in the same event?
example: <INPUT ... onclick="return checkform2();this.form.action='itemLevel2_add.asp'">

but its not work!!

glenngv
01-03-2003, 10:09 AM
the 2nd statement will not be executed because of the return in the first statement.
show us the whole html and javascript codes.

NinjaTurtle
01-03-2003, 10:23 AM
i solve the problem. i plug in the second script to the end of the 1st script. :) TQ.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum