Form Validation with Multiple Select

More
12 years 7 months ago #18960 by Brat
I tried to search for this here and at the Joomla forums, so apologies if this is a repeated topic.

Just ran into one small snag.

The rest of my form validates as it should EXCEPT FOR the multiple select. No matter what I do, I cannot seem to get this element to validate. Everything else (textarea, input, etc.).

Any ideas? Thanks! 8-)

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #18979 by ggppdk
I think current validation code makes no checks for this fields.

What kind of validation you want to do? You mean to make it required?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #19010 by Brat
Sorry that I wasn't clear. That's what happens when I type tired. :oops:

Yes, to make it required. I have only one required field that is multiple select. The person only needs to select one value to pass validation.

Unfortunately, as you've said, there currently is no code that validates multiple select.

I've searched at Joomla.org and other places, but thus far I cannot find a solution to this.

Please Log in or Create an account to join the conversation.

More
12 years 7 months ago #19019 by ggppdk
The code for validation is Flexicontent code.

I will check why it does not work for selectmuiltiple field.


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 6 months ago #19378 by Brat
SOLVED (for me at least)

NOTE: This is for Joomla 1.5.

I did a LOT of research into this, and finally stumbled on the solution in the official Joomla 1.5 bug tracker.

A programmer submitted a patched version of the core Joomla validate.js that contains a solution for a LOT of validation issues (including multiple select).
I've tested this on my WAMP test site, and it appears to work.

I've attached this as a ZIP file for your review. Some people may not want to have to actually replace a core Joomla file to get this to work, so perhaps the code could be somehow implemented in Flexi or even as a separate plugin to override the core validate JS somehow?

UPDATE: replaced with a corrected version which works fully on Joomla 1.5 (previous one was a developer port from 1.6 that didn't work as well as this one).
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.272 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline