Javascript blank verification still does not work. this is a restaurant website. you can select the number of dishes in the menu and put them in the shopping cart. PHPcodewhile (...) {echo & quot; & lt; formnameshopping_cart_for?hodpostaction=deshopping_cart_form.phponsubmitr javascript blank verification still does not work
This is a restaurant website. you can select the number of dishes from the menu and put them in the shopping cart.
PHP code
while(...){echo "";}
The post I posted previously asked, but I am wrong. form is in the loop, so it cannot be determined by getElementById. I would like to thank T5500 for its help.
Each form has only one input type = text. now, before each form is submitted, how can we determine that each text cannot be empty or 0 ??
------ Solution --------------------
Onsubmit = 'return dosubmit ();'
Change
Onsubmit = 'return dosubmit (this );'
Js
JScript code
Function dosubmit (fmt) {if (fmt. textbox_qty.value = '') {fmt. textbox_qty.focus (); alert ('cannot be blank '); return false;} return true ;}
------ Solution --------------------
Function isEmpty ()
{
Function isEmpty (){
The function is named twice. Is it a mistake or something?