Click here to Skip to main content
15,887,214 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionThe problem of JavaScript position Pin
Ted.K-121-Nov-15 21:28
Ted.K-121-Nov-15 21:28 
AnswerRe: The problem of JavaScript position Pin
Peter Leow21-Nov-15 21:55
professionalPeter Leow21-Nov-15 21:55 
AnswerRe: The problem of JavaScript position Pin
Cai Yang17-Dec-15 23:42
Cai Yang17-Dec-15 23:42 
Questionsocial media buttons block page on IE? Pin
V.17-Nov-15 21:18
professionalV.17-Nov-15 21:18 
QuestionHow to create a number field site column in javascript Pin
Member 1188942312-Nov-15 19:54
Member 1188942312-Nov-15 19:54 
QuestionRe: How to create a number field site column in javascript Pin
ZurdoDev23-Nov-15 3:03
professionalZurdoDev23-Nov-15 3:03 
Questionregex, get the last dollar amount if 2 are present Pin
jkirkerx12-Nov-15 8:51
professionaljkirkerx12-Nov-15 8:51 
AnswerRe: regex, get the last dollar amount if 2 are present [Solved] Pin
jkirkerx12-Nov-15 9:35
professionaljkirkerx12-Nov-15 9:35 
I changed the source of the regex to the latter part of the string index instead.
That's what happens when you have to go back to code you wrote years ago. You forget exactly how it operates and you have to rethink it again.
var rate_API_Text = $('input[name*="_lb_OP_AO_S2_Quotes_Original_Field"]:checked').next().text();
var n = rate_API_Text.indexOf("--");
var rate_API_Name = rate_API_Text.substr(0, n - 1);
$('[id*="_lbl_OP_AO_S2_Dashboard_StatusMessage_Field"]').text(rate_API_Name);

var rate_Amount = rate_API_Text.substr(n, rate_API_Text.length - 1);
var re_ratePlan = new RegExp("(\\$[0-9,]+(\\.[0-9]{2})?)");
var match_ratePlan = re_ratePlan.exec(rate_Amount);
if (match_ratePlan.length !== null || match_ratePlan.length > 0) {
    for (var i = 0; i < match_ratePlan.length; i++) {
        rate_Amount = match_ratePlan[i] + "\n";
        break;
    }
    if (match_ratePlan !== null) {
        $('[id*="_lbl_OP_AO_S2_Dashboard_Calc_RateAmount_Field"]').text(rate_Amount);                
    }
    else {
        $('[id*="_lbl_OP_AO_S2_Dashboard_Calc_RateAmount_Field"]').text("$0.00");
        $('[id*="_txt_Estimated_Rate_Field"]').val(rate_Amount);
    }
}

QuestionJavaScript Tour guide Pin
Member 1198488311-Nov-15 21:14
Member 1198488311-Nov-15 21:14 
AnswerRe: JavaScript Tour guide Pin
Richard MacCutchan11-Nov-15 21:19
mveRichard MacCutchan11-Nov-15 21:19 
GeneralRe: JavaScript Tour guide Pin
Member 1198488311-Nov-15 21:33
Member 1198488311-Nov-15 21:33 
AnswerRe: JavaScript Tour guide Pin
Richard Deeming12-Nov-15 2:13
mveRichard Deeming12-Nov-15 2:13 
QuestionJava 2D Array - User Input Pin
Frankie124510-Nov-15 13:02
Frankie124510-Nov-15 13:02 
QuestionRe: Java 2D Array - User Input Pin
Richard MacCutchan10-Nov-15 23:09
mveRichard MacCutchan10-Nov-15 23:09 
QuestionHow can I collect news from differnt sites in one html page Pin
abo sohaib9-Nov-15 20:18
abo sohaib9-Nov-15 20:18 
AnswerRe: How can I collect news from differnt sites in one html page Pin
Afzaal Ahmad Zeeshan9-Nov-15 20:34
professionalAfzaal Ahmad Zeeshan9-Nov-15 20:34 
GeneralRe: How can I collect news from differnt sites in one html page Pin
abo sohaib10-Nov-15 10:36
abo sohaib10-Nov-15 10:36 
QuestionImage does not display in Firefox Pin
ParthiR5-Nov-15 0:57
professionalParthiR5-Nov-15 0:57 
AnswerRe: Image does not display in Firefox Pin
Afzaal Ahmad Zeeshan9-Nov-15 20:39
professionalAfzaal Ahmad Zeeshan9-Nov-15 20:39 
GeneralRe: Image does not display in Firefox Pin
ParthiR11-Nov-15 19:10
professionalParthiR11-Nov-15 19:10 
Questionform question Pin
Member 1197204322-Oct-15 17:43
Member 1197204322-Oct-15 17:43 
AnswerRe: form question Pin
W Balboos, GHB27-Oct-15 8:16
W Balboos, GHB27-Oct-15 8:16 
GeneralRe: form question Pin
Member 1197204327-Oct-15 9:24
Member 1197204327-Oct-15 9:24 
PraiseRe: form question Pin
Richard Deeming28-Oct-15 3:34
mveRichard Deeming28-Oct-15 3:34 
GeneralRe: form question Pin
W Balboos, GHB28-Oct-15 4:05
W Balboos, GHB28-Oct-15 4:05 

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.