Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Cap on multiple drop-down menu options

Hello!
1) Please check this post https://getsatisfaction.com/apperyio/...
2) There is no standard function to prevent user to select more than 5 items (http://api.jquerymobile.com/selectmenu/). You can do it yourself using JS. For example before sending data check how many elements are selected and if there are more than 5 - show some message and prevent sending data.

Doz
Posts: 0
Joined: Sun Oct 27, 2013 9:01 am

Cap on multiple drop-down menu options

Gees! Is it so difficult for anyone to give me a tip here which is actually helpful? I understand that you must all be very busy but please I have been stuck on this issue for almost two weeks now. I have reviewed all the relevant tutorials and I have shared my app. I had already visited the links which Maryna referred me to. The guy's problem was actually different from what I face now. Moreover, you guy's did not seem to solve it for him.

If you really want to help me, please actually look at what I have shared, the components and the mapping. Then, please tell me:

1) What is wrong with my UI set up?
2) What is wrong with my mapping?
3) What is wrong with my database?

PLEASE! PLEASE!! PLEASE!!! If it helps, I am a paying user.

I have included my question once more below:

"I am building an app. I have set up a sign_up service. One of the sign_up requirements is for the user to select his occupation(s) using the select component. I am able to get the selected occupation to appear on the database when only one occupation can be selected. But when I enable the multiple selection feature, the user's selected occupation(s) no longer appears on the database. Please EXPLAIN how I can solve this problem. Is there something wrong with my UI, mapping or database? I have read every tutorial that may apply to this but I am yet to get a solution. I have also looked at similar topics in the support forum section."

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Cap on multiple drop-down menu options

Hello! Developers team is working on your request at the moment. We'll let you know as soon as have information.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Cap on multiple drop-down menu options

Hi,

1) In your JavaScript1 there is an html document instead of valid JS code. Please delete it.

2) In service 'Constet1_signup_service' mapping there is a JS code for 'cb_occupationstext':preAppery("cb_occupationstext").val();/preThis is incorrect. The function returns nothing, but you're attempting to use a result in 'cb_occupationstext'.
What should you return depends on your column 'cb_occupationstext' type. That is depends on how you will use the data (for example, to create sample or to map a result easier).

If the column 'cb_occupationstext' is a String, then there should be the following code in mapping:prevar arr = Appery("cb_occupationstext").val();
if (arr && arr.length) {
return Appery("cb_occupationstext").val().join(",");
}
return Appery("cb_occupationstext").val();/pre
If it's an Array:prereturn Appery("cb_occupationstext").val();/pre
3) To choose no more than 5 points, on save button click don't call service for saving, and run JS that does the test and depending on the result either alert a warning or invoke a data saving service:prevar arr = Appery("cb_occupationstext").val();
if (arr && arr.length 5){
alert("You should select less than 5 items for Occupation");
} else {
try {
serviceName.execute({});
} catch (ex) {
console.log(ex.name + ' ' + ex.message);
hideSpinner();
};
}/preWhere serviceName is a name of service that saves data to database.

Doz
Posts: 0
Joined: Sun Oct 27, 2013 9:01 am

Cap on multiple drop-down menu options

It worked!!! Finally!!!! Thanks a million, Katya. I appreciate your actually looking at the app I shared and coming up with a solution.

Return to “Issues”