Selected value in a drop down

pdemaers

New Member
Hi,

I have two drop down fields on a form, each representing the status of a registration.

  • Field A is only editable by a club administrator and has 3 values.
  • Field B in editable by the federation administrator (read only for the club administator) and has 4 values.
  • If the federation administrator choses a certain value (e.g. 'Not valid' in this case) then Field A should revert to its default value (no matter what value was selected)
How can I achieve this ? I suppose a Javascript validation on the onchange event of Field B ? Or is there another way ?

Cheers,

Patrick
 
yes you would have to do some js to achieve this. Add an onchange event to fieldb:

Say you wanted to reset fielda when fieldb's value was '0'

Code:
var v = this.getValue();
if(v == '0'){
 $('tablename___fielda').selectedIndex = -1;
}

you would need to replace 'tablename___fielda' with fielda's html id.

hth
Rob
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top