Forums

Forums / Developing Portals / Can I set a field as invalid through javascript?

Can I set a field as invalid through javascript?

Thread is closed for posting
4 posts, 1 answered
  1. geoff.white
    geoff.white avatar
    31 posts
    Registered:
    27 Jan 2015
    10 Nov 2016
    Link to this post
    Can I set a field as invalid through javascript?

    I have a function to determine if a field is true or false and can display a message but this still allows the field to be submitted.

    Geoff
  2. Missing user
    Missing user avatar
    11 Nov 2016 in reply to geoff.white
    Link to this post
    Hi Geoff,

    You need to set your function to return true or false based on validation result. Then, call your function on the "OnClientClick" event of submit button. To locate the OnClientClick event for your form "Submit" button goto;

    "Submit button"-->"Edit"-->"Advanced"-->"OnClientClick"--> call your Javascript function using condition so that if it returns true then, the form will submit otherwise, the user will be prompted message and will stay on the same form.

    Example of sample function call to put under OnClickClieckEvent box;    

    if(!​YourJavaScript​Functioname()==false)





    Last modified on 11 Nov 2016 22:11 by Missing user
  3. geoff.white
    geoff.white avatar
    31 posts
    Registered:
    27 Jan 2015
    01 Dec 2016 in reply to Missing user
    Link to this post
    Is this available on the Multi-Form Step Buttons? I can't see a OnClientClick field in advanced options for Multi-Form Step Buttons.
  4. Missing user
    Missing user avatar
    Answered
    01 Dec 2016 in reply to geoff.white
    Link to this post
    Hi Geoff,

    Inside the Advanced property of multi step button, you need to click on sub property called "btnNext", and then you will be able to see "OnClientClick" option.

    I have emailed you a screenshot to locate "btnNext" under multi step button advanced properties.

    Thanks
    Syed
4 posts, 1 answered