Viewing 1 replies (of 1 total)
  • I am also trying to add email or any other validation to dynamic text fields which can be addded to other fields like phone, required, date,pattern etc (some field-types/validations made available by additional addon plugin for cf7).
    The above idea of adding class to dynamictext fields will work if something like below possible with this plugin
    [dynamictext dynamicemail “CF7_GET key=’email'” class:wpcf7-email]
    but I tried and it doesn’t work.

    I tried to add required using * like below,
    [dynamictext* dynamicemail “CF7_GET key=’email'”]
    Luckily it worked, added ‘wpcf7-validates-as-required’ class in frontend and required validation also working!! nice.

    This proves that adding some custom classes to dynamictext fields can make all needed validations working but if this plugin can successfully parse it.

    ——-
    Or, the other alternative could be, if we can use dynamictext with combining other fields like
    [email* your-email class:customclass dynamictext “CF7_GET key=’email'”]

    If above can be possible, it can work like a charm with any other fields or any type and any validations, but may be not in scope of this plugin.
    ———-

    The third alternative is to use jquery to prefill any normal cf7 form fields with $_REQUEST[‘fieldkey’] values. This doesn’t even require this dynamictext plugin.

    For ex.,
    $(document).ready(function(){
    var email = ‘<?php echo $_REQUEST[’email’] ?>’;
    var phone = ‘<?php echo $_REQUEST[‘phone’] ?>’;
    $(‘#your-email’).val(email);
    $(‘#your-phone’).val(phone);
    });

    Here your-email, your-phone etc. are ids of fields created using contact form 7 itself.

    Thanks
    Shashank

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Contact Form 7 Dynamic Text Extension] Adding E-Mail Validation’ is closed to new replies.