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!

lock fields

Status
Not open for further replies.

mary555

Programmer
Nov 9, 2005
185
CA
i have a form with many dependent drop down menus and text fields. I need it to work so the user has to enter the fields in order. is there a simply way to do this? Maybe to disable certain fields?
 
yes. disable them using CSS and then enable them using the onchange event of the previous field...

Code:
<form>
<select name="s1" onchange="this.form.s2.disabled=false;">
  ...
</select>
<select disabled name="s2" onchange="this.form.s3.disabled=false;">
  ...
</select>



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
thank you. what about if i already have an onchange event for the select boxes (submitting the form/refresh). is there a way to have 2 events?
 
and i actually tried using that code and it didn't disable anything...
 
if you are submitting the form to query a database and populate the select boxes based on a value selected in the previous select box, then you should disable the select boxes by writing appropriate code on the server side, not using javascript.



*cLFlaVA
----------------------------
[tt]( <P> <B>)[sup]13[/sup] * (<P> <.</B>)[/tt]

[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top