• Resolved pablow3v

    (@pablow3v)


    Hi, good morning.
    Could you tell me which function is called after the user complete a field? (Before click at the registration button).

    I want to put a ‘validation’ before user click in the registration button.

    (I tried some functions but none work how I want).

    I don’t know if I were clear, so an example: After the user put the email would show a notification “the email is too short…”.

    Thank you for the help, support and congratulations for your the plugin and website.

    https://www.ads-software.com/plugins/wp-members/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter pablow3v

    (@pablow3v)

    More one thing. I were testing some function like this:

    if($fields['somefield1'] == 'something'){
    		 $fields['somefield2'] = 'newthing';
    }

    The variable was changed but it’s not showing in the form. How could I do this?

    Thank you a lot.
    Pablo

    Plugin Author Chad Butler

    (@cbutlerjr)

    You can’t validate the form fields prior to the button being clicked using the plugin (as you described). If you want that type of validation, you’d need to write (and load) some client side javascript to handle it.

    You can, however, add your own custom validation to the form upon submission. Using the wpmem_pre_register_data action hook, if you validate whatever field you want (or multiple fields), if the data doesn’t meet whatever criteria, set a value for $wpmem_themsg as the error message.

    https://rocketgeek.com/wp-members-users-guide/filter-hooks/wpmem_pre_register_data/

    The second thing you asked – setting a value of something based on another field’s value – can be done filtering the posted form results with wpmem_register_data:

    https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_register_data/

    Thread Starter pablow3v

    (@pablow3v)

    Hi, I need to do a extra button that it validate one field and other thing. I have a function that do this but the way that i call it conflicts with the form.

    I’m use it:

    
    <script type="text/javascript" src="https://code.jquery.com/jquery-1.7.1.js" ></script>
        <script type="text/javascript" src="https://(WebSite).com/ajax.js" ></script>
    

    And I used “ajax” to call the php file to do the validation by the extra button.

    How can I call this function without conflicts with the form?

    If you can tell me how I can put the extra button beside a field it’ll help very much too.

    Thank you for all help until now.
    Pablo

    • This reply was modified 8 years, 6 months ago by pablow3v.
    Thread Starter pablow3v

    (@pablow3v)

    One more thing, when I don’t fill a required field, when I press the button to register a mensagem is shown to fill all required field.

    I want to call a validation before it call that message. The “wpmem_pre_validate_form” is called after this message.

    How could I call it before?

    Have a good day and thanks very much.

    Pablo

    Thread Starter pablow3v

    (@pablow3v)

    Huum…

    Plugin Author Chad Butler

    (@cbutlerjr)

    One more thing, when I don’t fill a required field, when I press the button to register a mensagem is shown to fill all required field.

    I want to call a validation before it call that message. The “wpmem_pre_validate_form” is called after this message.

    The plugin’s HTML for the forms uses HTML5. HTML5 has automatic form validation built in. So if a field is marked as required, you will receive a message right away. That’s the message you are talking about. HTML5 validation happens before any submit event, in all browsers, so it’s not possible to do anything prior to that.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Function called before registration’ is closed to new replies.