J and Beyond 2013 | An International Joomla! Conference - May 31st - 2nd, 2013, Noordwijkerhout, The Netherlands
It is currently Sat May 18, 2013 10:44 am

Custom Fields Error  Topic is solved

Forum for JEvents 3.0 for Joomla 3.0 and 2.5.

Re: Custom Fields Error  Topic is solved

Postby Fredie » Sun Feb 17, 2013 1:29 pm

Thanks! I can now save changes to required fields. - fred
Fredie
Gold Members
Posts: 147
Joined: Fri Jan 04, 2013 4:41 pm

Re: Custom Fields Error

Postby Fredie » Mon Apr 29, 2013 1:27 am

Geraint wrote:Please change line 234 of plugins/jevevents/jevcustomfields/customfields/jevcfform.php to
Code: Select all
if(testitem.name == name || "custom_"+testitem.name == name || testitem.id == name  || ("#"+testitem.id) == name  || testitem.hasClass(name.substr(1))){
from
Code: Select all
if(testitem.name == name || testitem.id == name  || ("#"+testitem.id) == name  || testitem.hasClass(name.substr(1))){

Then the required check should work.


This worked to resolve a problem with submitting a required custom field, but now I've encountered a similar issue. I need to add a multiple select option, and I would prefer to have it displayed as multiple checkboxes so I've added a custom field type='jevcfcheckbox' with allowmultiple='1' and required='1'. Even after changing the default option, the form will not save. No matter what's selected, it keeps producing the field required message. I have other required fields that are working when this new field isn't included. Here's the code for the field
Code: Select all
<field name="danceLevel" type="jevcfcheckbox" default="-1" label="Dance Level(s)" required="1" description="Select Dance Level" filter="1" allowoverride="1" allowmultiple="1" access="1" requiredmessage="Select the main Dance Level for this dance/event. If it's not a dance, select NA" readaccess="1">
<option value="-1">Select One or more</option>
            <option value="0" default="0" >Basic</option>
            <option value="1" default="0" >MS</option>
            <option value="2" default="0" >Plus</option>
            <option value="3" default="0" >Adv</option>
            <option value="4" default="0" >C</option>
            <option value="5" default="0" >DBD</option>
            <option value="6" default="0" >Rnds</option>
            <option value="7" default="0" >Other</option>
            <option value="8">NA</option>
         </field>
Fredie
Gold Members
Posts: 147
Joined: Fri Jan 04, 2013 4:41 pm

Re: Custom Fields Error

Postby Fredie » Mon Apr 29, 2013 1:42 am

P.S. After posting the previous message, I discovered that all of the options didn't have a positive value greater then zero, so I changed the code to what's given below. I also tried various default options, but the form still will not save no matter what's selected.
Code: Select all
<field name="danceLevel" type="jevcfcheckbox" default="1" label="Dance Level(s)" required="1" description="Select Dance Level" filter="1" allowoverride="1" allowmultiple="1" access="1" requiredmessage="Select the main Dance Level for this dance/event. If it's not a dance, select NA" readaccess="1">
            <option value="1" default="0" >Basic</option>
            <option value="2" default="0" >MS</option>
            <option value="3" default="0" >Plus</option>
            <option value="4" default="0" >Adv</option>
            <option value="5" default="0" >C</option>
            <option value="6" default="0" >DBD</option>
            <option value="7" default="0" >Rnds</option>
            <option value="8" default="0" >Other</option>
            <option value="9" default="0" >NA</option>
</field>
Fredie
Gold Members
Posts: 147
Joined: Fri Jan 04, 2013 4:41 pm

Re: Custom Fields Error

Postby Geraint » Mon Apr 29, 2013 9:22 am

Checking required fields for multiple checkboxes is potentially complex - is it required that one or all of the fields are checked?

There is a glitch in the javascript code for Joomla 3.0 which I have a fix for and will include in a new release later today. NOTE that it will check for at least one of the options to be selected AND the default value at field level MUST be set to zero i.e. it will look for one of the checkboxes to have a value that doesn't match this. Or otherwise you would do something like this
Code: Select all
    <field name="danceLevel" type="jevcfcheckbox" default="6" label="Dance Level(s)" required="1" description="Select Dance Level" filter="1" allowoverride="1" allowmultiple="1" access="1" requiredmessage="Select the main Dance Level for this dance/event. If it's not a dance, select NA" readaccess="1">
                <option value="1" default="0" >Basic</option>
                <option value="2" default="0" >MS</option>
                <option value="3" default="0" >Plus</option>
                <option value="4" default="0" >Adv</option>
                <option value="5" default="0" >C</option>
                <option value="6" default="1" >DBD</option>
                <option value="7" default="0" >Rnds</option>
                <option value="8" default="0" >Other</option>
                <option value="9" default="0" >NA</option>
    </field>

In this case one of the options OTHER than 6 must be selected.
------------
JEvents club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits.

Join the JEvents club today!
User avatar
Geraint
Posts: 30507
Joined: Fri Feb 15, 2008 6:14 pm

Re: Custom Fields Error

Postby Fredie » Mon Apr 29, 2013 12:20 pm

Thank you. I think I can make this work. I want at least one item selected.
Fredie
Gold Members
Posts: 147
Joined: Fri Jan 04, 2013 4:41 pm

Re: Custom Fields Error

Postby Geraint » Mon Apr 29, 2013 12:25 pm

I should have the new release available in about an hour from now.
------------
JEvents club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits.

Join the JEvents club today!
User avatar
Geraint
Posts: 30507
Joined: Fri Feb 15, 2008 6:14 pm

Re: Custom Fields Error

Postby Fredie » Mon Apr 29, 2013 6:52 pm

Thank you. Updating to Customfields ver 3.0.7 has enabled me to achieve a require multiple select with checkboxes.
Fredie
Gold Members
Posts: 147
Joined: Fri Jan 04, 2013 4:41 pm

Previous

Return to JEvents 3.0 (Free Access)

Who is online

Users browsing this forum: lebspy

Main Menu

User Menu

Hosted By


Who is online

In total there is 1 user online :: 1 registered and 0 hidden (based on users active over the past 5 minutes)
Most users ever online was 94 on Tue Sep 01, 2009 12:33 am

Users browsing this forum: lebspy

Login Form