Upload
ahmadesty-tohir
View
213
Download
0
Embed Size (px)
Citation preview
8/18/2019 Disallow the Firs Element in Drop Down Menu _ Fabrik
1/3
1/28/2016 Disallow the firs element in drop down menu | Fabrik
http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/
Disallow the firs element in drop down menu
Home Forums Wiki Members
Home » Forums » Fabrik 2.x » Feature Requests » Completed
KietnaQuTakNew Member
Dec 11, 2008
Hello! In one of forms made in Fabrik v2.0 b3 I'm using drop down element with several options to chose. I wish
this element to be required and have first/default element something like "Please chose something" and disallow
to chose it. I want user to chose anything else except this first option, because it is only like a label saying "when
you click here you'll see more option and you need to chose something". How can I do a validation plugin for
such element? I was testing with adding lable to the first/default element "blad" (which means "error" in polish
) and validation plugin with function:
function validate( $wybor, &$element, $c )
{
if ( $wybor == 'blad') return false;
else return true;}
But it doesn't show any error message if the first option from drop down will be selected. How can I solve this
issue (it don't need to be done with validation plugin, maby there is some better way to disallow selecting
first/default element form drop down).
Best regards
Kietna Qu'Tak
nunocordeiroNew Member
KietnaQuTak said: ↑
Hello! In one of forms made in Fabrik v2.0 b3 I'm using drop down element with several options to chose. I wish this element to be
Log in
Search Forums Recent Posts
http://fabrikar.com/http://fabrikar.com/forums/index.php?members/kietnaqutak.17371/http://fabrikar.com/http://fabrikar.com/forums/index.phphttp://fabrikar.com/http://fabrikar.com/forums/index.php?members/nunocordeiro.17350/http://fabrikar.com/forums/index.php?find-new/postshttp://fabrikar.com/forums/index.php?search/&type=posthttp://fabrikar.com/forums/index.php?login/http://fabrikar.com/forums/index.php?goto/post&id=45994#post-45994http://fabrikar.com/forums/index.php?members/nunocordeiro.17350/http://fabrikar.com/forums/index.php?members/nunocordeiro.17350/http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/http://fabrikar.com/forums/index.php?members/kietnaqutak.17371/http://fabrikar.com/forums/index.php?members/kietnaqutak.17371/http://fabrikar.com/forums/index.php?forums/completed.90/http://fabrikar.com/forums/index.php?forums/feature-requests.78/http://fabrikar.com/forums/index.php#fabrik-2-x.74http://fabrikar.com/forums/index.phphttp://fabrikar.com/http://fabrikar.com/forums/index.php?misc/quick-navigation-menu&selected=node-90http://fabrikar.com/forums/index.php?members/http://fabrikar.com/forums/index.php?wiki/http://fabrikar.com/forums/index.phphttp://fabrikar.com/http://fabrikar.com/
8/18/2019 Disallow the Firs Element in Drop Down Menu _ Fabrik
2/3
1/28/2016 Disallow the firs element in drop down menu | Fabrik
http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/
Dec 11, 2008
I did this by using the validation by regular expression.
Then I used a regular expression that matched everything except the value of the default element.
For example: the values you you can choose go from monday to sunday
1. You add the "Select a day" option and name the corresponding value "default_selection" and set it as default.
2. Add a regular expression match that looks like this /^[^d]/ (matches any string that doesn't start with a 'd'.
3. Set you error desired error message and shazzam... it's working! =)
required and have first/default element something like "Please chose something" and disallow to chose it.
KietnaQuTakNew Member
Dec 11, 2008
Simple and WORKING! Nothing more to say than: THANKS A LOT :-D
nunocordeiroNew Member
Dec 11, 2008
You're most welcome =)
Don't forget to close the thread.
KietnaQuTak said: ↑
Simple and WORKING! Nothing more to say than: THANKS A LOT :-D
skhMember
Actually, there is a new validation plugin called isnot which is utilized for something like your asking, they can
pick anything in the list except what is set...such as please select...
http://fabrikar.com/forums/index.php?members/skh.15895/http://fabrikar.com/forums/index.php?members/skh.15895/http://fabrikar.com/forums/index.php?goto/post&id=46032#post-46032http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/#post-46046http://fabrikar.com/forums/index.php?members/nunocordeiro.17350/http://fabrikar.com/forums/index.php?members/nunocordeiro.17350/http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/#post-46032http://fabrikar.com/forums/index.php?members/kietnaqutak.17371/http://fabrikar.com/forums/index.php?members/kietnaqutak.17371/http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/#post-46018
8/18/2019 Disallow the Firs Element in Drop Down Menu _ Fabrik
3/3
1/28/2016 Disallow the firs element in drop down menu | Fabrik
http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/
(You must log in or sign up to reply here
Tw eet
Share This Page
Dec 12, 2008
The plugin is not automatically loaded but you can see how to add it here:
http://fabrikar.com/forums/showthread.php?p=45172#post45172
Cheers,
Keith
1 person likes this.
cheesegritsSupport Gopher
Staff Member
Dec 13, 2008
Yup, that's exactly why I added the 'isnot' validation ... Terp finally nagged me in to it.
-- hugh
1 person likes this.
Log in
Useful Links
Create a Fabrik Account
Fabrik Wiki
Fabrik on github
Members Online Now
Total: 50 (members: 0, guests: 37, robots: 13)
3.1 Github Commits
Be the first of your friends to recommend this.Recommend
http://fabrikar.com/forums/index.php?online/https://github.com/Fabrik/fabrik/http://fabrikar.com/forums/index.php?wiki/index/http://fabrikar.com/subscribehttp://fabrikar.com/forums/index.php?login/http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/#post-46173http://fabrikar.com/forums/index.php?members/cheesegrits.13364/http://fabrikar.com/forums/index.php?members/cheesegrits.13364/http://fabrikar.com/forums/showthread.php?p=45172#post45172http://fabrikar.com/forums/index.php?threads/disallow-the-firs-element-in-drop-down-menu.8788/#post-46130https://twitter.com/intent/tweet?original_referer=http%3A%2F%2Ffabrikar.com%2Fforums%2Findex.php%3Fthreads%2Fdisallow-the-firs-element-in-drop-down-menu.8788%2F&ref_src=twsrc%5Etfw&text=Disallow%20the%20firs%20element%20in%20drop%20down%20menu&tw_p=tweetbutton&url=http%3A%2F%2Ffabrikar.com%2Fforums%2Findex.php%3Fthreads%2Fdisallow-the-firs-element-in-drop-down-menu.8788%2Fhttp://fabrikar.com/forums/index.php?login/