javascript - i have textbox in which i want the user to enter only 5000 or 5000+ number -
this question has answer here:
$gramweight = $ary['packagingweightgram']; $qtyunit = $ary['packagingunit']; $weight = $weight + ((ceil($qty/$qtyunit) * $gramweight)/1000); $freightprice = calculateshipfreight($pricemode,$weight,$countryid); break; case 1: //was earlier postal method, never got programmed because discontinued break; case 2: //first need find weight of cards shipped... //then need find corresponding value per zone $sql = "select * sizespecification sizespecificationid=$sizespecificationid"; //print $sql; //exit; $result = mysql_query($sql,$link); $ary = mysql_fetch_array($result); if($stocktypeid == 1) $weight = $ary['weightperdozen']; else $weight = $ary['weightperdozenplastic']; $sql = "select quantity quantity quantityid=$quantityid"; $result = mysql_query($sql,$link); $ary = mysql_fetch_array($result); $qty = $ary['quantity']; ### if quntity cutom 101 bot 100 if ($_post['qtytype'] == 'customquantity'){ $primeryqty = $qty; $qty = $_post['txtquantity']; } ### close $weight = ($qty / 12) * $weight; $sql = "select * packaging packagingid = $packagingid"; $result = mysql_query($sql,$link); $ary = mysql_fetch_array($result); $gramweight = $ary['packagingweightgram']; $qtyunit = $ary['packagingunit']; $weight = $weight + ((ceil($qty/$qtyunit) * $gramweight)/1000); $freightprice = calculatefedexfreight($pricemode,$weight,$countryid); // added on thursday, june 30, 2005 3:21:15 pm //to decrease_fedexfreight($freight, $quantity) $freightprice = decrease_fedexfreight($freightprice, $qty); break; } return $freightprice; } have table name quantity in these have 4 columns quantityid has value 1,2,3,4,5,6,7,8,.....,quantity has value 1,12,100,200,500,1000,2000,5000,10000,25000,50000,priority has value 10,20,30,40,50,60.transportpref has value ars............. have textbox in want user enter 5000 or 5000+ number , if user enter less 5000 shoul prompt user enter more 5000 have textbox in want user enter 5000 or 5000+ number , if user enter less 5000 shoul prompt user enter more 5000
i have textbox in want user enter 5000 or 5000+ number , if user enter less 5000 shoul prompt user enter more 5000 have textbox in want user enter 5000 or 5000+ number , if user enter less 5000 shoul prompt user enter more 5000
hope following code snippet :
<!doctype html> <html> <body> <h2>javascript can validate input</h2> <p>please input number between 5000 or 5000+:</p> <input id="numb"> <button type="button" onclick="myfunction()">submit</button> <p id="demo"></p> <script> function myfunction() { var x, text; // value of input field id="numb" x = document.getelementbyid("numb").value; // if x not number or less 1 or greater 10 if (isnan(x) || x < 5000 ) { text = "input not valid"; } else { text = "input ok"; } document.getelementbyid("demo").innerhtml = text; } </script> </body> </html>
Comments
Post a Comment