Not signed in (Sign In)

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorvijender
    • CommentTimeApr 20th 2011
     
    Hi,

    I have one form which has 2 fields:
    1)UserName
    2)Password

    I want to customize the error message as per fields i.e. for username it should show "Please enter username" and for password it should show "Please Enter Password" Can anyone let me know how to customize this in WForm.

    Any help will be highly appreciated.

    Regards,
    Vijender
    • CommentAuthordbuschho
    • CommentTimeApr 20th 2011
     
    Hello Vijender,

    It's mildly difficult to set custom error messages. Are you sure that setting a hint for your field, so that when users click on it, they see a message like 'Please enter username' isn't more what you want?

    Also, you probably shouldn't be collecting usernames and passwords with FormAssembly. It's against our policy to allow you to do so for third-party services ( too much chance of phishing ) and as we don't offer a login service, just doesn't make much sense to do for a registration.

    What you are using it for?

    FormAssembly.com Support
    • CommentAuthorvijender
    • CommentTimeApr 20th 2011
     
    Hi,

    Thanks a lot for your reply.

    Actually We have one simple html form and there I am using WForm open source javascript library. I have fields there like First Name,Last Name and so on. When I am clicking on submit button I want message to display as "Please enter user name" and "Please enter Last Name". I applied class required with both the text fields. It always shows the message as "Field is required" for both the fields but I want this to be changed according to the field.

    Note : I am able to change the display message "field is required" for all the fields by changing this text in "wforms_validation.js" but I am not able to change it as per the field.

    Please let me know if you need more clarification on this.

    Regards,
    Vijender
    • CommentAuthorvijender
    • CommentTimeApr 21st 2011
     
    Hi,

    Can you please help me on the above case ASAP.

    Thanks in advance for your needful.

    Regards,
    Vijender
    • CommentAuthordbuschho
    • CommentTimeApr 21st 2011 edited
     
    Hello vijender,

    In order to have a custom error message for each field, you will need to:
    1. Extend the example error routines ( see examples from within this forum or here:
    http://code.google.com/p/wforms/source/browse/trunk/customization/wforms_custom_validation.js
    2. Change the validation for each field in the html code to run those separate validation routines for each field.

    Happy to help further,
    FormAssembly.com Support