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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating text fields upon button click

Status
Not open for further replies.

camcim

Programmer
Jan 25, 2003
20
0
0
US
Hello,
I have the following script:

Code:
<html>
<body>
  <form name=&quot;Form1&quot;>
  <table>
     <tr>
          <td width=&quot;21%&quot; nowrap><b>Property/Investment Name:</b>
            <input type=&quot;text&quot; size=77 name=&quot;pos1&quot; onKeyUp=&quot;document.forms[1].PropertyName.value=this.value&quot;><br />
           </td>
      </tr>
  </table>
  </form>
  <FORM name=&quot;theform&quot; METHOD=&quot;POST&quot; ACTION=&quot;email@company.com&quot;>
  <table>
     Property/Investment Name: &nbsp; <INPUT TYPE=&quot;text&quot; NAME=&quot;PropertyName&quot; SIZE=&quot;30&quot;><br />
  </table>
  </form>
</body>
</html>

Can anyone tell me how i can change this script so that the top text field does not automatically populate the bottom text field.
Instead, i want it to populate the bottom text field upon a button click (submit button).
Any ideas most appreciated.

Thanks,
camcim
 
Here ya go:
Code:
<html>
<body>
  <form name=&quot;Form1&quot;>
  <table width=&quot;89%&quot;>
     <tr>
          <td width=&quot;21%&quot; nowrap><b>Property/Investment Name:</b>
            <input type=&quot;text&quot; size=77 name=&quot;pos1&quot;>
            <input type=&quot;button&quot; name=&quot;enter&quot; value=&quot;Enter&quot; onClick=&quot;document.forms[1].PropertyName.value=pos1.value&quot;> </td>
      </tr>
  </table>
  </form>
  <FORM name=&quot;theform&quot; METHOD=&quot;POST&quot; ACTION=&quot;email@company.com&quot;>
  <table>
     Property/Investment Name:   <INPUT TYPE=&quot;text&quot; NAME=&quot;PropertyName&quot; SIZE=&quot;30&quot;><br />
  </table>
  </form>
</body>
</html>
I have not failed; I have merely found 100,000 different ways of not succeding...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top