Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

poulate form values

Status
Not open for further replies.

plork123

Programmer
Mar 8, 2004
121
GB
hi all

is this possible

if i have 2 forms on a page
<form>
<input type="text" name="form1" value="hello"/>
</form>

<form>
<input type="text" name="form2" value=form1/>
</form>

i want to put the value from form 1 into form 2 when the page is loaded. so when the page is in a broswer it'll have 2 input boxes both saying hello

can someone show me how to do this

many thanks
 

You would require, some sort of programming language.

Javascript, Vbscript if you wanted to do it client side, or PHP or ASP if you wanted to do it server side.

There is no way it can be done using plain HTMl, other than writing the same thing on both forms manually.




----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 


could you give me some elp doing this in javascript?
 
it would be something like this:
Code:
<form name="form1" >
<input type="text" value="somevalue" name="textbox1">
</form>
<form name="form2">
<input type="text" name="textbox2" value"">
</form>

<script language="javascript">
document.form2name.textbox2name.value=document.form1name.textbox1name.value;
</script>

Hope this helps

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top