Jump to content

firefox

Members
  • Posts

    1
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

firefox's Achievements

Newbie

Newbie (1/14)

  1. I haven't seen a response yet... There are 2 ways you can do this. OPTION 1 - More than 1 form tag <form name="Menu" method="post" action=""> <input name="Height1" type="text" size="10" value="Change Me"> <input type="button" onclick="Save()" style="color:ff0000" value="Change me."> </form> <script type="text/javascript" language="javascript"><!--// function Save(){ //document.<form-name>.<input-name> document.Menu.Height1.value = "This has been changed!"; } //--> </script> OPTION 2 - Unique IDs I have never had any issues with the getElementById function as mentioned on this page and this is usually most compatible with all browsers. You can use this, just make sure the tag has an id element and that it is a unique name. I always use getElementById. <form name="Menu" method="post" action=""> <input name="Height1" id="Height1" type="text" size="10" value="Change Me"> <input type="button" onclick="Save()" style="color:ff0000" value="Change me."> </form> <script type="text/javascript" language="javascript"><!--// function Save(){ //document.getElementById("<input-id>") document.getElementById("Height1").value = "This has been changed!"; } //--> </script> Hope this helps!
×
×
  • Create New...