Jump to content

javascript help


frozentree

Recommended Posts

i got a problem here..but it dint work...i wonder why? any1 can help me? thks man<html><head><script type="text/javascript">function Prototype (){ rental=prompt("Type the word",""); }document.form.box2.value=rental</script><body onload="Prototype()"><form name="form"><input type=text name="box2" ></form></body></html>

Link to comment
Share on other sites

<html><head><script type="text/javascript">function PrototypeFunction(){rental=prompt("Type the word","");document.getElementById('formname').box2.value=rental}</script><body onload="PrototypeFunction()"><form id="formname"><input type=text name="box2" ></form></body></html>

Link to comment
Share on other sites

Guest prethesh
i got a problem here..but it dint work...i wonder why? any1 can help me? thks man<html><head><script type="text/javascript">function Prototype (){  rental=prompt("Type the word","");  }document.form.box2.value=rental</script><body onload="Prototype()"><form name="form"><input type=text name="box2" ></form></body></html>

put the Declaration "document.form.box2.value=rental" inside the javascript function Prototype()
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...