Forums

Select validation error

nesa 05 Apr, 2011
Hi All,

I have a validation issue with drop down list (select), validation works fine for all other fields (text box, text area, etc) but it does not validate select drop down list.

I checked similar issues posted in this forum and took steps mentioned there but it did not help me.

Below is the form code:

Select drop down 1 for Country :
<select class="cf_inputbox validate-selection required" id="select_6" size="1" title="Select your country from the list"  name="country">
                <option value="">Select Country</option> 
                <option value="United States">United States</option> 
                <option value="United Kingdom">United Kingdom</option> 
                <option value="Afghanistan">Afghanistan</option> 
                ........ 
                ........ 
                <option value="Yemen">Yemen</option> 
                <option value="Zambia">Zambia</option> 
                <option value="Zimbabwe">Zimbabwe</option>
                </select>

Select drop down 2 for credit card type :
<select class="cf_inputbox validate-selection required" id="select_16" size="1" title="Select your card type"  name="paycardtype">
          <option value="">Select</option>
<option value="Visa Card">Visa Card</option>
<option value="Master Card">Master Card</option>
    </select>


My Joomla version : Joomla! 1.5.22
Mootools upgrade: disabled
Chronoforms version: ChronoForms V3.2.0
Chronoforms Plugin version: ChronoForms V3.1_RC5.2

If someone has faced similar issues, let me know.
Thanks in Advance.
GreyHead 06 Apr, 2011
Hi Nesa,

I just pasted your credit card example into a form and the validation works OK here :-(

Please post a link to the form so we can take a quick look.

Bob
GreyHead 07 Apr, 2011
Hi Nesa,

it looks to me as though you are using the copy of jsvalidation2.js I modified to work with MooTools 1.2 but you are using MooTools 1.12 still. If you switch back to the original MooTools 1.12 versions of the files it should be OK.

The error comes up at line 228
if ( !field.match('form') ) {


Bob

PS I think that the error is because the match() method expects a string and not an Object.
nesa 11 Apr, 2011
Hi Bob,

Yes for another issue I had to use the mootool 1.2 version, I had kept backup, I switched back to the earlier version, it didn't work.

Also i uploaded the js file which was there in chronoforms package (ChronoForms_V3.2.0.zip), even this didn't help me :?
GreyHead 12 Apr, 2011
Hi nesa,

As far as I can see this is working OK now? Is it fixed?

Bob
01 15 Oct, 2012
Hi!
I'm full of error πŸ˜€
I've made custom multiselect element and I want that this element should be required. At least one selection must be made:

<select class="cf_inputbox validate-selection required" id="myList" name="adv[]" multiple="multiple" disabled='disabled' size="8">
   <option value="111">β€ž123β€œ</option>
    ...
</select>

I've added class="cf_inputbox validate-selection required" line, but validation check skips select element. Also tried
<select class="inputSelect required validate-selection" id="myList" name="adv[]" multiple="multiple" disabled='disabled' size="8">

I could provide a link to this form.
P.S. I've deleted the disabled='disabled', bet it doesn't make any sense, because I load additional JS
GreyHead 15 Oct, 2012
Hi 01,

This is an old thread from CFv3. The validation codes are different in CFv4.

Bob
01 15 Oct, 2012
Hi, GreyHead!

Understood. So it should be treated in this way?

<select class=" validate['required']" id="myList" name="adv[]" multiple="multiple" size="8">

But it also doesn't work😟
GreyHead 15 Oct, 2012
Hi 01,

That looks OK - but if this is the same form as in your other thread it won't work on the disabled select drop-down.

Bob
This topic is locked and no more replies can be posted.