Click here to Skip to main content
15,886,069 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: MSN style links Pin
thanh_bkhn23-Jun-13 16:09
professionalthanh_bkhn23-Jun-13 16:09 
GeneralRe: MSN style links Pin
Bart25-Jun-13 10:22
Bart25-Jun-13 10:22 
QuestionHow to show info marker google maps when clicked in outside map? Pin
Akbarblack22-Jun-13 4:12
Akbarblack22-Jun-13 4:12 
AnswerRe: How to show info marker google maps when clicked in outside map? Pin
Dan Randolph23-Jun-13 8:55
Dan Randolph23-Jun-13 8:55 
GeneralRe: How to show info marker google maps when clicked in outside map? Pin
Akbarblack10-Dec-13 20:32
Akbarblack10-Dec-13 20:32 
QuestionShopping Cart Qty Button - I need to make it faster Pin
jkirkerx21-Jun-13 11:16
professionaljkirkerx21-Jun-13 11:16 
AnswerRe: Shopping Cart Qty Button - I need to make it faster Pin
enhzflep24-Jun-13 11:19
enhzflep24-Jun-13 11:19 
GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
jkirkerx24-Jun-13 11:38
professionaljkirkerx24-Jun-13 11:38 
I didn't notice the numerous calls to the qty textbox.

What I did think of, is that perhaps I should just assume that the value is correct or an integer, and if not, then run the rest of the script. It's really fast now, and does not hesitate anymore.

On the iPhone, it was a matter of making the increment buttons bigger for a more positive contact with the finger or thumb.

Did I mention that it's just a webpage running on a phone?

Love the feedback though, this function has been giving me trouble for quite a while now, if you think my new idea is bad, just let me know.

[Edit]

Hey Eric, just saw your name on the post. Let me know what you think of the new design below, if it sucks, please let me know so I can work on it again. Thanks Jim

function jquery_Add2Cart_Numeric_Up() {

    try {
        var qty = parseInt($('[id*="_txt_Modal_Add2Cart_SelectQty"]').val());
        if (qty < 1000) {
            qty++;
            $('[id*="_txt_Modal_Add2Cart_SelectQty"]').val(qty);
        }
    }
    catch (err) {

        var vFlag = true;
        var txtFocus = $('[id*="_txt_Focus_Field"]').val();
        var txtError = $('[id*="_txt_Error_Field"]').val();

        var qty_value = $('[id*="_txt_Modal_Add2Cart_SelectQty"]').val();
        if (qty_value.length < 1) {
            $('[id*="_txt_Modal_Add2Cart_SelectQty"]').css('background-color', txtError);
            vFlag = false;
        }
        else if (qty_value.length > 0) {
            $('[id*="_txt_Modal_Add2Cart_SelectQty"]').css('background-color', txtFocus);

            var re_Qty = new RegExp("^([1-9]|[1-9][0-9]|[1-9][0-9][0-9])$")
            var txt_Qty = $('[id*="_txt_Modal_Add2Cart_SelectQty"]').val();
            var match_Qty = re_Qty.exec(txt_Qty);
            if (match_Qty == null) {
                $('[id*="_txt_Modal_Add2Cart_SelectQty"]').css('background-color', txtError);
                $('[id*="_lbl_Modal_Add2Cart_Center_Container_QtyMessage"]').text("Invalid Quantity!");
                $('[id*="_txt_Modal_Add2Cart_SelectQty"]').val("1");
                vFlag = false;
            }
            else if (match_Qty !== null) {
                $('[id*="_txt_Modal_Add2Cart_SelectQty"]').css('background-color', txtFocus).show();
                $('[id*="_lbl_Modal_Add2Cart_Center_Container_QtyMessage"]').text("Select your quantity:");
            }
        }
    }
    return false;
}

GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
enhzflep24-Jun-13 12:15
enhzflep24-Jun-13 12:15 
GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
jkirkerx24-Jun-13 12:33
professionaljkirkerx24-Jun-13 12:33 
GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
enhzflep24-Jun-13 12:53
enhzflep24-Jun-13 12:53 
QuestionJavascript, KnockoutJS (and possibly TypeScript) Pin
_Maxxx_19-Jun-13 18:32
professional_Maxxx_19-Jun-13 18:32 
AnswerRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
AlphaDeltaTheta19-Jun-13 19:00
AlphaDeltaTheta19-Jun-13 19:00 
GeneralRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
_Maxxx_20-Jun-13 1:29
professional_Maxxx_20-Jun-13 1:29 
GeneralRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
AlphaDeltaTheta20-Jun-13 1:37
AlphaDeltaTheta20-Jun-13 1:37 
AnswerRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
Payrok17-Jul-13 5:45
Payrok17-Jul-13 5:45 
GeneralRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
_Maxxx_17-Jul-13 13:01
professional_Maxxx_17-Jul-13 13:01 
GeneralLooking for team Pin
ashkanpower17-Jun-13 23:03
ashkanpower17-Jun-13 23:03 
GeneralRe: Looking for team Pin
Richard MacCutchan17-Jun-13 23:35
mveRichard MacCutchan17-Jun-13 23:35 
GeneralRe: Looking for team Pin
ashkanpower18-Jun-13 0:49
ashkanpower18-Jun-13 0:49 
QuestionHTML issue with IE. Pin
InderK17-Jun-13 3:17
InderK17-Jun-13 3:17 
AnswerRe: HTML issue with IE. Pin
Richard Deeming17-Jun-13 4:46
mveRichard Deeming17-Jun-13 4:46 
GeneralRe: HTML issue with IE. Pin
InderK19-Jun-13 1:25
InderK19-Jun-13 1:25 
AnswerRe: HTML issue with IE. Pin
Dholakiya Ankit10-Aug-13 1:43
Dholakiya Ankit10-Aug-13 1:43 
AnswerRe: HTML issue with IE. Pin
Dholakiya Ankit12-Sep-13 1:10
Dholakiya Ankit12-Sep-13 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.