English 中文(简体)
利用 j,对照各种其他隐蔽的最低价值检查多种投入价值
原标题:Using jQuery to check multiple input values against various other hidden minimum values

我有一份产品清单,这些产品在秘密投入中拥有最低数量。 一些产品有多种颜色,尽管最低数量相同,但I m试图进行“ j鱼”检查,检查条目至少等于最低限度。

空白或0项条目是罚款,但如果低于最低数量,则应定为最低数量。

传真:

    <div class="ProductGrouping"> <!-- with colours -->
    <input id= frmQuickAdd1234c1  name= frmQuickAdd1234c1  type= text  style= width: 40px; text-align: center;  class= auto {mDec: 0}  value=   /> Black

    <input id= frmQuickAdd1234c2  name= frmQuickAdd1234c2  type= text  style= width: 40px; text-align: center;  class= auto {mDec: 0}  value=   /> White
    <input id="QuickAddMinOrderQty1234" name="QuickAddMinOrderQty1234" type="hidden" class="auto {mDec: 0}" value="6" />
    </div>
    <div class="ProductGrouping"> <!-- without colours -->
    <input id= frmQuickAdd4567  name= frmQuickAdd4567  type= text  style= width: 40px; text-align: center;  class= auto {mDec: 0}  value=   /> Product B
<input id="QuickAddMinOrderQty4567" name="QuickAddMinOrderQty4567" type="hidden" class="auto {mDec: 0}" value="3" />
</div>

j 质量:

<script type="text/javascript">
jQuery(document).ready(function(){
    if (jQuery.browser.msie) {
        jQuery("[id=^frmQuickAdd]").bind("keyup", CheckStr);
        };

    jQuery( [id=^frmQuickAdd] ).change(CheckMin);
    function CheckMin(){
        var AmountStr = jQuery(this);
        var Amount = Number(AmountStr.val().replace(/[$£,]+/g,""));
        var ProductScope = jQuery(this).parent("div.ProductGrouping")
        var MinQtyStr = jQuery("[id=^QuickAddMinOrderQty]",ProductScope);
        var MinQty = Number(MinQtyStr.val().replace(/[$£,]+/g,""));
        if (parseFloat(Amount) == 0){}
        else if (parseFloat(Amount) ==   ){}
        else if(parseFloat(Amount) < parseFloat(MinQty)){
            AmountStr.val(MinQtyStr.val());
            };
    };
    function CheckStr(){
        if (isNaN(jQuery(this).val() )) {
            var ProductScope = jQuery(this).parent("div.ProductGrouping")
                jQuery(this).val(jQuery("[id=^QuickAddMinOrderQty]",ProductScope).val())
        }
    };
});
</script>

这显然是错误的吗? 它是没有进行最低检查的,我确实不肯定为什么。

增 编

David

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签