0

In html page I have two forms:

<form name=fm1 method=post action=aaa.html>
<input type=text name=a1>
<textarea name=a2></textarea>
<input type=submit>
</form>

<form name=fm2 method=post action=bbb.html>
<input type=text name=b1>
<input type=submit>
</form>

Now the question is if I submit "fm2", is it possible to also submit the text area which is in "fm1"? I don't want to repeat the same text area in both "fm1" and "fm2", so this text area can either submit to "fm1", or "fm2".

Thanks for any help.

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by katarey
0

Hi there,

Well I didn't seen any direct way to do this, but you can use the, there may have a hidden field in fm2 for storing the value of textarea (fm1) and use this very very simple function to fill the value in hidden field.

<html>
<head>
<title> </title>
<script type="text/JavaScript">
<!--
Function filldata () { 
document.fm2.b3.value = document.fm1.a2.value;
}
//-->
</script>
</head>
<body>
<form name="fm1" method="post" action="aaa.html">
<input type="text" name="a1">
<textarea name="a2" onblur="filldata()"></textarea>
<input name="Submit" type=submit value="Submit">
</form>

<form name="fm2" method="post" action="bbb.html">
<input type="text" name="b1">
<input name="b3" type="hidden" value="" />
<input name="Submit" type="submit" value="Submit">
</form>
</body>
</html>

I hope it may help you,

Best Regards,
Rahul Dev

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.