Hi,

Can anyone help me to remove form field validation for "quantity" field? I want to make it optional.
Here is the code.
http://paste2.org/p/2168944

I tried to remove myself but got error "Sorry some error occurred and unable to...".
I will be very thankful for your help.

Regards,
Simon

line 63 change it as following we make quantity 0 if use keep it blank

if(trim(=$_REQUEST["es_quantity"])=='') 
        $es_quantity="0";
else
    $es_quantity=$_REQUEST["es_quantity"];

112-116 comment 4 lines

/*
if ( !is_numeric($es_quantity) || ($es_quantity < 0) )
        {
            $errs[$errcnt]="$Quantity_must_be_non_zero_positive_integer";
            $errcnt++;
        }
*/

replace 709 to 715 by following code

       if(frm.es_quantity.value!='') 
       {
                if( isNaN(frm.es_quantity.value) || frm.es_quantity.value<0)
                {
                    alert('Please specify Quantity as a non-negative integer');
                    frm.es_quantity.focus();
                    frm.es_quantity.select();
                    return(false);
                }   
         }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.