Page 1 of 3

Select menu

Posted: Tue Oct 15, 2013 5:05 am
by Ananya Raju

Designing a app in which i am trying to select countries in a select menu component, as it is difficult to enter all the countries in a list one by one is there any other alternative through which i can use a select component and have all the values of the countries?


Select menu

Posted: Tue Oct 15, 2013 5:34 am
by Kateryna Grynko

Hi Ananya,

No. You can store list of countries in Database and map them to a Select component, but this will slow down the application. So it's up to you to decide.


Select menu

Posted: Tue Oct 15, 2013 7:34 am
by Ananya Raju

OK oK now i am facing another problem.....
using the value selected in the select menu of d countries i need to display a image in the corresponding image tag..... i have uploaded images onto appery .... \
For example wen i select USA i need the Image asset to change into the USaflag.jpg can u pls help me with a Js.... all the images are uploaded onto appery and the select menu has all the values of countries so,
when i select a component on the select i want its respective image to be displayed


Select menu

Posted: Tue Oct 15, 2013 9:39 am
by Ananya Raju

PLs Any1 pls do Help me With this


Select menu

Posted: Tue Oct 15, 2013 10:56 am
by Kateryna Grynko

Hi Ananya,

If you store file name in a Select component then you can add the following JavaScript on Select component valueChange event:
codevar newPath = $($(Appery("mobileselectmenu_6")).find("option:selected")).attr("value");
Appery('mobileimage_9').attr("src", "files/views/assets/image/" + newPath);
Appery('mobileimage_9').refresh();/code
where mobileselectmenu_6is a select component name
mobileimage_9 is an image component name


Select menu

Posted: Tue Oct 15, 2013 12:04 pm
by Ananya Raju

Thanks for your help and support...
I m making a app with quiet a few lists and at the end there is a submit button...
i want to assign a property to all the lists and inpbox components in such a way that the submit button will be dimmed unless n until all the feilds r entered by the user.... and then i want the submit button to be enabled........hope u r getting wat i wanted to say.... this is to signify the user that he has accidently forgotten to select a option hence cannot continue... is this possible?


Select menu

Posted: Tue Oct 15, 2013 12:36 pm
by Maryna Brodina

You can add verification for all necessary components and save value of that verification to "flag" variable. If it's equal to true - make the button active, if false - not active.
preif (flag === true){
Appery("mobilebutton_211").removeClass("ui-disabled");
} else {
Appery("mobilebutton_211").addClass("ui-disabled");
}/pre


Select menu

Posted: Wed Oct 16, 2013 6:09 am
by Ananya Raju

HI Maryna Brodina,
I didnt understand!
suppose i named my components as below
L1, }
L2, } LISTS
L3 }
and
inputbox1, }
inputbox2 } INPUT BOX
inputbox3 }

SUBMIT } button

How can i set the verification for all necessary components and save value of that verification to "flag" variable?
and how can i set the property to the SUBMIT button?


Select menu

Posted: Wed Oct 16, 2013 9:10 am
by Kateryna Grynko

Hi Ananya,

codeflag = Appery("mobiletextinput_1").attr("value") === "" & Appery("mobiletextinput_2").attr("value") === "" & Appery("mobiletextinput_3").attr("value") === "&quot/code
This is for Inputs. What do you want to check in List?


Select menu

Posted: Thu Oct 17, 2013 4:25 am
by Ananya Raju

Thanks for the inputBox in Lists i have to check whether a user has made selection...for Eg. in a list containing countries i want the user to select a particular country and then only proceed .....
One more thing
"if (flag === true){
Appery("mobilebutton_211").removeClass("ui-disabled");
} else {
Appery("mobilebutton_211").addClass("ui-disabled");
}"

where should i write this code ? on the click event of the submit button?

and the above codes for input should that be written on which event of the input box?
input event or value change?