+ 3

I want to enable send button on condition.

I want to enable send button when fulfil all condition. https://code.sololearn.com/W7SqVwAoxKn7/?ref=app

10th Jun 2018, 12:49 AM
Satish Kumar Sharma
Satish Kumar Sharma - avatar
6 Respostas
+ 4
//You can use flags and based upon the flag set disability of your button var length_valid = 0; var txt_valid = 0; if (m!=0) { length_valid = 0; ... //Other code } else { length_valid = 1; .. //Other code } if(maxTxtVal < 0) { txt_valid = 0; ... //Other code } else { txt_valid = 1; ... //Other code } if(length_valid && txt_valid) { document.getElementById ("submit").disabled = false; } else { document.getElementById ("submit").disabled = true ; }
10th Jun 2018, 1:58 AM
Gopal Gautam
Gopal Gautam - avatar
+ 2
ok thanks
10th Jun 2018, 2:28 PM
Satish Kumar Sharma
Satish Kumar Sharma - avatar
10th Jun 2018, 2:31 PM
Gopal Gautam
Gopal Gautam - avatar
+ 2
Thanks a lot.
10th Jun 2018, 2:38 PM
Satish Kumar Sharma
Satish Kumar Sharma - avatar
+ 1
I used your code but another problem show in line no. 10.
10th Jun 2018, 2:12 PM
Satish Kumar Sharma
Satish Kumar Sharma - avatar
+ 1
I didnt write whole code. I just showed you how can it be done
10th Jun 2018, 2:25 PM
Gopal Gautam
Gopal Gautam - avatar