Need to hide/reveal form fields

Results 1 to 2 of 2

Thread: Need to hide/reveal form fields

  1. #1
    Mark Guest

    Default Need to hide/reveal form fields

    I am working in ASP, but need to find either a javascript/dhtml solution to this:<BR>I need to make form fields visible and set their text based on selections from dropdown boxes. Any suggestions?

  2. #2
    Franco Guest

    Default RE: Need to hide/reveal form fields

    When you say form fields, do you mean input boxes?<BR><BR>Filling in any control on the page involves creating a jscript code. Say you want the input box MyBox to change every time someone changes the value of the dropdown list MySelect. Both are in MyForm. Add this:<BR><BR>&#060;script language=javascript&#062;<BR><BR>function MySelect_onchange()<BR>MyForm.MyBox.value=MyForm.M ySelect.value;<BR><BR>&#060;/script&#062;<BR><BR>Make the MySelect control look like the following:<BR><BR>&#060;select name=MySelect id=MySelect onchange=MySelect_onchange()&#062;<BR><BR>That should make the MySelect control reference the script every time it&#039s changed.<BR><BR>Feel free to change the event or the control to suit your needs.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts