Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

How to block Submit button when input cells as empty?

9:14 am on May 18, 2015 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month

joined:Oct 25, 2006
votes: 1

I have seen simple solved solution how to block link at button (Submit button) when form is not with all values.

Example: class disabled.

How to do it actually in Javascript as usually (in the past) it will work validation only when you click Submit button. In this case it is blocked link till you fill in all input values.
10:25 pm on May 27, 2015 (gmt 0)

Full Member

10+ Year Member

joined:Jan 2, 2005
votes: 0

Have the initial state as disabled on page load.

Create a function that checks if all the input values are populated after any change to an input field.

If yes, remove the disabled state.
5:02 am on Aug 5, 2015 (gmt 0)

System Operator from US 

incredibill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Jan 25, 2005
votes: 99

use this code, just reverse it to look for the value(s) to be empty instead of full

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members