Page 2 of 3

Select menu

Posted: Thu Oct 17, 2013 7:57 am
by Kateryna Grynko

Hi Ananya,

Saying you want the user to select a particular country do you mean using List or Select component?
The code should be added on Button Click event.


Select menu

Posted: Thu Oct 17, 2013 8:04 am
by Ananya Raju

YEss... unless he doesnt select a country he is not allowed to proceed....
pls help me with that code!.

this event i added on page load
flag = Appery("mobiletextinput_1").attr("value") === "" & Appery("mobiletextinput_2").attr("value") === "" & Appery("mobiletextinput_3").attr("value") === "";

and the other code i added this too on d same page load
if (flag === true){
Appery("mobilebutton_211").removeClass("ui-disabled");
} else {
Appery("mobilebutton_211").addClass("ui-disabled");
}
is this correct?


Select menu

Posted: Thu Oct 17, 2013 12:55 pm
by Kateryna Grynko

Hi Ananya,

You can use the following code to get Select component value:
codevar selected = Appery("mobileselectmenu_28").find(":selected").attr("value");/code
After that, you can insert it into the empty string check (or another one).

Regarding the correctness of the code insertion, it depends on when you need to perform this check ... If on page load - then add it to Page Load event, if on button click - then use Button click event.


Select menu

Posted: Fri Oct 18, 2013 4:30 am
by Ananya Raju

Sorry i still didnt get it..... i tried it on page load but it just checks the value when the page is loaded n not later on when all the fields are entered.....pls give me a solution such that i can use the above code to validate my form so that it also checks when all the fields are entered a value....
The layout of my project is
Image
at first since all the fields are empty i want the submit button's UI to be disabled and then after all the values and the countries selection is made i want the of the Submit button to be Enabled... PLs tell me where i should put which code so as to validate my form,


Select menu

Posted: Fri Oct 18, 2013 1:46 pm
by Kateryna Grynko

Hi Ananya,

Then you should place the validation code in custom JavaScript separate function, and call it on Value change event for each component.


Select menu

Posted: Fri Oct 18, 2013 4:44 pm
by Ananya Raju

What u r saying is
flag = Appery("mobiletextinput_1").attr("value") === "" & Appery("mobiletextinput_2").attr("value") === "" & Appery("mobiletextinput_3").attr("value") === "";
must be placed on each inputbox on valu change?
var selected = Appery("mobileselectmenu_28").find(":selected").attr("value");
this must be placed on the select menu on value change?
and
if (flag === true){
Appery("mobilebutton_211").removeClass("ui-disabled");
} else {
Appery("mobilebutton_211").addClass("ui-disabled");
} must be made into a customJS right?
did i get the order correct this time on where what code must be placed?


Select menu

Posted: Fri Oct 18, 2013 7:11 pm
by Maryna Brodina

Hello! Create JS asset with code:
prefunction checkForm() {
var flag = (Appery("mobiletextinput_1").val() !== "") && (Appery("mobiletextinput_2").val() !== "") && (Appery("mobiletextinput_3").val() !== "");
var selected = Appery("mobileselectmenu_28").find(":selected").val() !== "";
if (flag && selected) {
Appery("mobilebutton_211").removeClass("ui-disabled");
} else {
Appery("mobilebutton_211").addClass("ui-disabled");
}
}/pre
On Input and Select value change events add code:
precheckForm();/pre


Select menu

Posted: Thu Jul 17, 2014 2:49 pm
by EJLD

I posted by mistake :-)


Select menu

Posted: Thu Jul 17, 2014 3:07 pm
by EJLD

Hello Everyone,
in fact I do a question.
1/ i made the db table with records,
2/ i'd like to use the select menu,
3/ how do you populate this select menu ?
I tried few things in mapping fiels to selectMenu control and nothing work so far.

thk you in advance,
Eric


Select menu

Posted: Thu Jul 17, 2014 8:56 pm
by Kateryna Grynko