cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Enabling "Is Required" on "Visitor verification Q&A" field types
November 13, 2007
11:03 am
Daniel
Guest

 

Hi Oliver,
Your wonderful plugin is working like a charm but some of my visitors find it confusing that the “Visitor verification Q&A” is not marked with “Is required” when all other mandatory fields are marked with “Is Required”.
Can I add something to the code to allow for the “ Is Required” option to be selectable for “Visitor verification (Q&A)” field types as well.
Your help is much appreciated

Browser: Firefox 2.0.0.9/IE6
Cforms II version: 5.5
URL: http://www.koptips.nu/nytt-tips/

November 13, 2007
12:01 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Yep, it's quite easy: go to line ~431 in cforms-options.php and remove 'verification' from this line:

<?php if( in_array($field_type,array('multiselectbox','checkb…

This should do it. 

November 14, 2007
6:15 pm
daniel
Guest

Dear Oliver, thank you for your quick answer

Your suggested adjustment allowed for a check-box for Visitor Verification (Q&A).
Unfortunately when selecting this new option and updating the settings inside “Form Settings”, the check-box gets unchecked.

I.e the option is selectable but does not seam to be assigned to the appropriate variable.
Is there an option-array that needs to be updated as well?

November 14, 2007
6:21 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Ah, right. Forgot to add that you need to add it to the 'allowed' list in lib_options_sub.php (~ line41):

 

if(isset($_REQUEST['field_' . $i . '_required']) && in_array($type,array('textfield','datepicker','text…

Simply add:

if(isset($_REQUEST['field_' . $i . '_required']) && in_array($type,array('verification','textfield','datepicker','text…

 This should do it, I think ;-)

 

November 14, 2007
11:40 pm
daniel
Guest

Yes that did it, the Q&A is now a required field.
In fact it is so much required so that the regular Q&A function stopped working.

When the form has been completed, including the (Q&A) and is submitted, the “Fill out the required field”-error message is presented for the Q&A-field.
The Q&A-field has also been cleared.
Guess you can’t have it all :)

If this is very complex perhaps you can point me to part of the code that generates the html for the Q&A field so I can hard code a “Is required”.

November 15, 2007
7:20 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Hm, sorry it wasn't as easy as I had hoped – it came of top off my head. If I find the time the next days, I'll take a closer look into the code, for the time being, the work around would be to simply ad some text after:

$field = '<input type="text" name="cforms_q'.$no.'" id="cforms_q'.$no.'" class="secinput ' . $field_class . '" value="" />';

e.g.

$field = '<input type="text" name="cforms_q'.$no.'" id="cforms_q'.$no.'" class="secinput ' . $field_class . '" value="" />'.'<span class="reqtxt">Is required</span>';  

(line ~1140, cforms.php

November 22, 2007
8:13 pm
Daniel
Guest

Thanks and if any one else want do this, you might need to add some margin CSS (input.secinput in your .css file) to get the required text to look consistent.

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
30 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3745

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5345

Posts: 18714

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)