Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Alert if same item is selected in other replicant
monu1
Hi ,
I have requirement where if some country e.g India is selected in one of the drop down values , then there should be a validation in the the other replicant for the user to alert not to select the same value.
Any clues or ideas will be helpful. Some form validation code will help .
Find more posts tagged with
Comments
nipper
Start reading the FormAPI manual. That is a common requirement and is easily implemented.
Aghosh
When the user is selecting the value get the old values from the already selected replicants and do an iteration to check if that values matches with the one the user is tying to select and pop an alert and clear the selection if the string matches.
You can use on item change even or some other event . do a google it very well explaned the website page
monu1
The requirement is little changed,its something like if you have 5 items in a replicant , then the other replicant should have atleast one different value selected in dropdown.If the user selects all the same values in any 2 replicants then there should be a alert message.
Sean_Hanck
You'll need to figure out when you want the validation to take place first. It could happen as the user fills out the form or when they try to save the form. Once that is decided, figure out what the validation is that you want to execute, thats where the logic will go.
Use the right event (such as onSave or onReplicantAdded) to trigger your logic javascript. But read the documentation (not Google it), FormAPI is one of the places where it is acceptable.
monu1
Hi ,
The Onsave event should work better a the form will be validated against the array strings and it will compare so that if same array string is found the form will be invalidated.Let me know if anyone has some code pointers for it.
bittu
Monu,
OnItemChange will work for you.
You have to loop through your replicant child values and has to store in an array.
After that you can compare those array values and show alert message if both values are same.
It will be good if you attach your dct code and your tried .js code.