jjqbunty
-
Posts
7 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by jjqbunty
-
-
Guys help me please, check if my code can work properly...
<script type="text/javascript" language="JavaScript">
function qtycheck() {
if (qty_1.value > qtyact_1.value)
{
qty_1.value=00
qtyactc_1.value = "Stock Alert"
document.getElementById("qtyactc_1").style.backgroundColor = "#FF4533";
return false;
} else {qtyactc_1.value = ""
}
} else {
if (qty_2.value > qtyact_2.value){
qty_2.value=00
qtyactc_2.value = "Stock Alert"
document.getElementById("qtyactc_2").style.backgroundColor = "#FF4533";
return false;
} else {qtyactc_2.value = ""
}//-->
</script> -
Thanks for the reply "justsomeguy" let me test..
Please comments on the second option as well...
var A = "qty_'+row_id+'".value;
var B = "qtyact_'+row_id+'".value;above code is fine? while I have multiple line to call.. Sorry for my bad programming knowledge
-
Code with Single/First Line is working fine (below) with below code. But after modification for multiple rows... my knowledge and even google is not able to help me :):)
<script type="text/javascript">
function qtycheck() {
var l = qty_1.value;
var h = qtyact_1.value;
//alert("hi " + h + " lo " + l);
if (l > h) {
qty_1.value=0
alert("not allowed");
} else {
alert("OK");
}
}
</script> -
I want when this function called by a button onchange, number in "qty" must not be greater then the number in "qtyact" if its greater then this will show the error...
Here we have multiple rows..
Sorry I am just a beginner and found this Inventory Source Code from the web.. and found a missing very important validation.
Thanks in Advance..
-
<script type="text/javascript">
function qtycheck() {
var l = "qty_'+row_id+'".val;
var h = "qtyact_value_'+row_id+'".val;
//alert("hi " + h + " lo " + l);
if (l > h) {
qty_1.value=0
alert("not allowed");
} else {
alert("ok, i'll allow it");
}
}
</script> -
<script type="text/javascript">
function qtycheck() {
var A = "qty_'+row_id+'".value;
var B = "qtyact_'+row_id+'".value;
if (A = or > B) {
"qty_'+row_id+'".value=0
alert("not allowed");
} else {
alert("OK");
}
}
</script>
Help Please
in JavaScript
Posted
no, its field name/id of my form..
Sorry for bad knowledge in programming....:(