0

hi ,

i have a php page with java script embed in it , i have 3 forms in a single page ... namely form1, form2, form3 .
form 1 and form2 have a text box , these text boxes get input from users. Now my task is to get the value of these 2 tex boxes in form3 when the user click the submit button , so that i pass the values in those text boxes to next page for calculation.

i tried the following code in form3 but it result in vain :

<script type='text/javascript' language='JavaScript'>
var resp_1= document.q1.response1.value;
document.counter.response1_user.value= resp_1;
</script>

q1 = name of form1 , response1 = text box in form1
counter = name of form3 , response1_user = text box in form3.

any help is appreciated ...

Thank you !

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by Venom Rush
0

u dont really need to make a variable resp_1 here. No harm if u made it.

put that code in a method say func1() and call it on the click of the submit of form1 or on click of a button. As u like.

0

@goldy

Hi, is there any reason you need to have the 2 values from form1 and form2 calculate into the text box in form3 before you go to the next page?

If not, then put the text box from form1 and form2 in a single form. Then when you submit the form to the next page do the calculations with the two values on that page.

Page 1

<form name='form1' method='post' action='nextpage.php'>
<input type='text' name='value1'>
<input type='text' name='value2'>
<input type='submit' value='Submit'>
</form>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.