Jump to content

PreventDefault when a section is not hidden


Recommended Posts

I have a submission form where I have sections that are hidden based on the input of the user (if the user input is not as desired, an error message is displayed by unhiding a section). Users should not be able to submit the form when any section is showing, for this i intent to use event.preventDefault(). How can I do this in javascript?

 

Any suggestion are welcome. 

Link to comment
Share on other sites

  • 3 weeks later...
On 8/26/2016 at 2:40 PM, Sander said:

I have a submission form where I have sections that are hidden based on the input of the user (if the user input is not as desired, an error message is displayed by unhiding a section). Users should not be able to submit the form when any section is showing, for this i intent to use event.preventDefault(). How can I do this in javascript?

 

Any suggestion are welcome. 

Hi Sander,

I suppose you may check input using "if else" statement. Please take a look at this solution, probably it might help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...