Solution for blank javascript verification-php Tutorial

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.