This topic is locked
[SOLVED]

 JavaScript OnLoad

10/3/2013 2:20:47 AM
ASPRunnerPro General questions
M
mr. zx author

Hi
can you please help me in this case.
On Add or Edit page

who can Hide or disable some fields, based on select value from drop-down list.

for example:

from drop-down select (x)

disable fields 1

disable fields 5

enable other

and when select (z)

disable fields 2

disable fields 4

enable other
Regards,

Mr. zx

admin 10/3/2013
M
mr. zx author 10/5/2013



Check this article for inspiration:

http://xlinesoft.com/asprunnerpro/docs/show_dropdown_list_of_us_states.htm


Thanks Admin for your reply but that example didn't match what i want.

admin 10/5/2013

Well, it does explain how to hide or show controls based on selection in another dropdown box. Unless I'm reading it wrong this is exactly what you asking.
If you need to make control disabled or enabled instead of hiding it use setDisabled/setEnabled functions:

http://xlinesoft.com/asprunnerpro/docs/ctrl_setdisabled.htm

M
mr. zx author 10/7/2013



Well, it does explain how to hide or show controls based on selection in another dropdown box. Unless I'm reading it wrong this is exactly what you asking.
If you need to make control disabled or enabled instead of hiding it use setDisabled/setEnabled functions:

http://xlinesoft.com/asprunnerpro/docs/ctrl_setdisabled.htm


Thanks admin you are true
i used this cod in JavaScript OnLoad :
var ctrlCountry = Runner.getControl(pageid, 'name');

var ctrlState = Runner.getControl(pageid, 'adress');
ctrlCountry.on('change', function(e){

if (this.getValue() == 'z'){

ctrlState.hide();

}else{

ctrlState.show();

}

});
var ctrlCountry = Runner.getControl(pageid, 'name');

var ctrlState1 = Runner.getControl(pageid, 'nationalty');
ctrlCountry.on('change', function(e){

if (this.getValue() == 'x'){

ctrlState1.hide();

}else{

ctrlState1.show();

}

});

__

it's working fine
thanks again admin
Regards,