2017-07-28 53 views
-2
    $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 we need to find the weight of the cards to be shipped... 
        //then we need to find its corresponding value as per its zone 

        $sql = "select * from sizespecification where 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 from quantity where quantityid=$quantityid"; 
        $result = mysql_query($sql,$link); 
        $ary = mysql_fetch_array($result); 
        $qty = $ary['quantity']; 

     ### if quntity is cutom then like 101 bot 100 
        if ($_POST['qtytype'] == 'customquantity'){ 
         $primeryQty = $qty; 
         $qty = $_POST['txtQuantity']; 
        } 
     ### Close 

        $weight = ($qty/12) * $weight; 

        $sql = "select * from packaging where 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; 
     } 



i have a table name quantity in these i have 4 columns quantityid has value like 1,2,3,4,5,6,7,8,.....,quantity has value like 1,12,100,200,500,1000,2000,5000,10000,25000,50000,priority has value like 10,20,30,40,50,60.transportpref has value like ARS............. 
i have textbox in which i want the user to enter only 5000 or 5000+ number and if user enter less than 5000 it shoul prompt user to enter more than 5000 
    i have textbox in which i want the user to enter only 5000 or 5000+ number and if user enter less than 5000 it shoul prompt user to enter more than 5000 

我已經在文本框,我希望用戶只輸入5000或5000 +號碼,如果用戶輸入小於5000是建議立即進行刪除提示文本用戶輸入超過5000 我有文本框,我希望用戶輸入只有5000或5000+數字,如果用戶輸入少於5000它提示用戶輸入超過5000我有,我希望用戶只輸入5000或5000+數量

+0

我們真的需要所有的代碼爲單個文本框? [MCVE]。 – Teemu

+1

您可以在輸入欄中設置最小值和最大值。 [看看](https://www.w3schools.com/tags/att_input_min.asp) –

+0

那麼,你想再次獲得什麼價值? – Cerbrus

回答

0

希望以下代碼段幫助你:

<!DOCTYPE html> 
 
<html> 
 
<body> 
 

 
<h2>JavaScript Can Validate Input</h2> 
 

 
<p>Please input a 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; 
 

 
    // Get the value of the input field with id="numb" 
 
    x = document.getElementById("numb").value; 
 

 
    // If x is Not a Number or less than one or greater than 10 
 
    if (isNaN(x) || x < 5000) { 
 
     text = "Input not valid"; 
 
    } else { 
 
     text = "Input OK"; 
 
    } 
 
    document.getElementById("demo").innerHTML = text; 
 
} 
 
</script> 
 

 
</body> 
 
</html>

0

您可以使用最小輸入號碼屬性,像這樣

<label> Number hours: </label> 
<textarea type="number" min="5000" name="Number"/> 

如果用戶將輸入小於5000會提示以上或數等於用戶5000

相關問題