Forums

Required Field in code V4 (NOT Wizard)

bellevue 26 Mar, 2012
I'm hoping someone can help me.

I have created a form and have input the html under the "Code" tab (I did not create the form using the wizard).

I wanting to make some fields required but don't know what code (or changes to code) I need to enter or where.

The form is quite long (with select boxes, text boxes and a text area) thus the html is lengthy too and I hope the answer isn't that I've got to start again but this time via the Wizard !

Any help would be appreciated and I've included some example code below:
<div class="ccms_form_element cfdiv_header" id="autoID-6a22021baa9659d784a21fc9fd19dade_container_div">Please complete all fields in the booking form below and press "Submit"; please note we do need this booking form in order to complete the booking process.<div class="clear"></div></div><div class="ccms_form_element cfdiv_header" id="autoID-7c704b7c5977c0271efb774d9c8defe0_container_div"><p><span style="text-decoration: underline;"><strong>Lead Member's Details</strong></span></p><div class="clear"></div></div><div class="ccms_form_element cfdiv_select label_over" id="autoID-f4568e6c36955db7c61923bc7c0c873d_container_div"><label>Title</label><select size="1" class=" validate['required']" title="" name="Title">
<option value="">Please Select</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
<option value="Dr">Dr</option>
</select>
<div class="clear"></div><div id="error-message-Title"></div></div><div class="ccms_form_element cfdiv_text" id="autoID-4cec0b0a74969e03d5ab8aa81068a526_container_div"><label>Initial</label><input maxlength="1" size="1" class="cf_inputbox required" title="" type="text" value="" name="Initials" />
<div class="clear"></div><div id="error-message-Initials"></div></div>

<div class="ccms_form_element cfdiv_text" id="autoID-6c569d7d7951288aac6170ac93f57de7_container_div"><label>Surname</label>
<input maxlength="150" size="30" class=" validate['required']" title="" type="text" value="" name="Surname" />
<div class="clear"></div><div id="error-message-Surname"></div></div>
GreyHead 26 Mar, 2012
Hi bellevue,

You need to add the validate['required'] class - see the firstr select box in your code - to the inputs that you want to be required.

Bob
bellevue 02 Apr, 2012
Thanks Bob, I understand.

However, if I go to the form in the "front end view" and skip the "Title" field, it allows me to complete all other fields, it doesn't prompt me that "Title" is required and it allows me to submit the form.

Needless to say, what I get through as an e-mail has all the data I've inputted except, of course, the empty "Title" field.

If I've entered the "class=" validate['required']" code correctly for the "Title" field, why isn't it prompting me that it's a required field ?

Thanks
GreyHead 03 Apr, 2012
Hi bellevue,

I copied this code into a test form and the validation works OK. I wonder if there is another 'title' input in the form somewhere else?

Bob
bellevue 03 Apr, 2012
Hello Bob

Thanks for that...I got excited for a moment thinking we'd found a solution but, alas, there's no other field called "Title" in the form.

In addition, the "Initial" and "Surname" fields are required (with the correct code in there) and they don't bring up the prompt either.

Any other suggestions please ?

Thanks
GreyHead 03 Apr, 2012
Hi bellevue,

Please take a Form Backup using the icon in the Forms Manager and post it here (as a zipped file) or PM or email it to me and I'll take a closer look.

Bob
bellevue 05 Apr, 2012
Thanks Bob

Sorry to sound thicker than before but when I try to do the backup, it asks what file type, what should I use ?

Thanks
GreyHead 05 Apr, 2012
Hi bellevue,

I don't see that. A backup is usually a .cf4bak file.

I just check the box by the form name, then the Backup Forms icon.

Bob
bellevue 05 Apr, 2012
Yes, I see that it's a .cf4bak file but the system keeps asking me what file type, anyway, I've selected excel, I hope that's right, have zipped it and have attached it.

Thanks
GreyHead 06 Apr, 2012
Hi bellevue ,

The form backup behaves OK here.

On the site, your template is loading an of an old version of MooTools v1.11. You need to block this and hopefully that will fix the problem.

Bob
bellevue 09 Apr, 2012
Thanks Bob

I've disabled the Mootools but when I go in to Forms Manager, it stated the following error message:

"Warning, your "Mootools upgrade" Joomla plugin is DISABLED, please ENABLE it under the Joomla "Plugins Manager" in order to have the wizard features working."

Furthermore, when I click on the "Create Table" button it shows this:
GreyHead 09 Apr, 2012
Hi bellebue,

You need the MooTools Upgrade enabled. It's the old version of MooTools loaded by the template that needs to be removed.

Bob
bellevue 11 Apr, 2012
Thanks Bob

I've tried to upload all of the Mootols versions shown at http://mootools.net/download
;however, I keep getting an error message which is "unknown archive type".

Do you know which version I should be uploading and from where please ?
GreyHead 12 Apr, 2012
Hi bellevue,

You shouldn't be uploading any versions of MooTools; you already have the correct one. The problem you have is that something on your site is also loading an old version of MooTools alongside the current one.

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