This topic is locked
[SOLVED]

 hide multiple fields

8/25/2016 8:22:23 PM
PHPRunner General questions
M
mhollibush author

I am looking for a way to hide the "state" and "zip" fields if US was not selected in the "country" field
I also need to show 2 fields if a specific country was selected from the drop down.
I have tried the example given and have tried a few different things form the web, but no go...
The example given in the manual
the form shows the field as soon as the page loads, then makes it disappear after selecting a different country other than "US"

but if you re-select "US" the field doesn't come back?

if "var ctrlCountry = Runner.getControl(pageid, 'country');



ctrlCountry.on('change', function(e) {

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

pageObj.showField("state");

} else {

pageObj.hideField("state");

}

});


I need to make these fields all "hidden" until the country is selected.
need these fields hidden until a country is selected

state

zip

sector
If "United States" is selected

then it will show

state

zip
if "Dominican Republic" is selected

then it shows

sector
Looking for any help

romaldus 8/26/2016



I am looking for a way to hide the "state" and "zip" fields if US was not selected in the "country" field
I also need to show 2 fields if a specific country was selected from the drop down.
I have tried the example given and have tried a few different things form the web, but no go...
The example given in the manual
the form shows the field as soon as the page loads, then makes it disappear after selecting a different country other than "US"

but if you re-select "US" the field doesn't come back?

if "var ctrlCountry = Runner.getControl(pageid, 'country');
ctrlCountry.on('change', function(e) {

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

pageObj.showField("state");

} else {

pageObj.hideField("state");

}

});


I need to make these fields all "hidden" until the country is selected.
need these fields hidden until a country is selected

state

zip

sector
If "United States" is selected

then it will show

state

zip
if "Dominican Republic" is selected

then it shows

sector
Looking for any help


pageObj.hideField("state");

pageObj.hideField("zip");

pageObj.hideField("sector");
var ctrlCountry = Runner.getControl(pageid, "country");

ctrlCountry.on('change', function()

{

if (this.getValue() == "United States")

{

pageObj.showField("state");

pageObj.showField("zip");

}

else

{

pageObj.hideField("state");

pageObj.hideField("zip");

}
if (this.getValue() == "Dominican Republic")

{

pageObj.showField("sector");

}

else

{

pageObj.hideField("sector");

}
});
M
mhollibush author 8/26/2016



pageObj.hideField("state");

pageObj.hideField("zip");

pageObj.hideField("sector");
var ctrlCountry = Runner.getControl(pageid, "country");

ctrlCountry.on('change', function()

{

if (this.getValue() == "United States")

{

pageObj.showField("state");

pageObj.showField("zip");

}

else

{

pageObj.hideField("state");

pageObj.hideField("zip");

}
if (this.getValue() == "Dominican Republic")

{

pageObj.showField("sector");

}

else

{

pageObj.hideField("sector");

}
});



Thanks for your response
After looking at what you posted, I figured out my main issue.... the field was in integer..... Was a long night... easy fix that I over looked... Thanks again!