Click here to Skip to main content
15,880,392 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: urdu Pin
Rahul Rajat Singh22-Aug-12 1:24
professionalRahul Rajat Singh22-Aug-12 1:24 
GeneralRe: urdu Pin
Sandip.Nascar22-Aug-12 11:03
Sandip.Nascar22-Aug-12 11:03 
QuestionLooping through elements, to find textbox, and get values Pin
jkirkerx8-Aug-12 13:12
professionaljkirkerx8-Aug-12 13:12 
AnswerRe: Looping through elements, to find textbox, and get values Pin
jkirkerx8-Aug-12 18:13
professionaljkirkerx8-Aug-12 18:13 
GeneralRe: Looping through elements, to find textbox, and get values Pin
Andrei Straut9-Aug-12 4:41
Andrei Straut9-Aug-12 4:41 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx9-Aug-12 6:27
professionaljkirkerx9-Aug-12 6:27 
AnswerRe: Looping through elements, to find textbox, and get values Pin
Andrei Straut9-Aug-12 9:37
Andrei Straut9-Aug-12 9:37 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx9-Aug-12 10:18
professionaljkirkerx9-Aug-12 10:18 
Your right, you have to tighten up the code to allow for input errors, been bit by the space before.

Just like in c++, you have to conserve resources, so I dumped the namecount, I thought about it, just didn't do it.

Glad the code is readable, know anything about consuming the eArray in a Web Service?, I posted it in the asp.net disscussion

// Create Arrays to hold the values
    var nameArray = [];
    $("._name_Field").each(function () { nameArray.push($(this).val()) });

    var codeArray = [];
    $("._code_Field").each(function () { codeArray.push($(this).val()) });

    // Gather the Data from the Element Containers from valid elements
    var jdx = 0
    for (i = 0; i <= parseInt($("._name_Field").length) - 1; i++) {
        // Only collect populated containers via jdx
        if ((nameArray[i].trim() != "") && (codeArray[i].trim() != "")) {
            elements[jdx] = [];
            elements[jdx]["name"] = nameArray[i].trim();
            elements[jdx]["code"] = codeArray[i].trim().toUpperCase();
            jdx++;
        }
    }

    var eArray = "";
    for (e = 0; e <= elements.length - 1; e++) {
        eArray = eArray + "{\"name\" : \"" + elements[e].name + "\", \"code\" : \"" + elements[e].code + "\"}";
        if (e <= elements.length - 2) { eArray = eArray + "," };
    }                               

    // Build the JSON Array
    var send_Data =
    "{" +
    "\"template_Name\" : \"" + template_Name + "\", " +
    "\"template_Array\" : [" + eArray + "]" +
    "}";

    alert(send_Data);

    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "productEditor.asmx/create_DynamicCart_Template",
        data: send_Data,
        dataType: "json",
        error: function (xhr, status, error) {

            exitCode = 2;
            alert(xhr.responseText);

        },
        success: function (responseText) {

            try {
                eval('(' + responseText.d + ')');
            }
            catch (err) {

            }

            alert(responseText.d);

            var objB = jQuery.parseJSON(responseText.d);
            exitCode = objB.template_ExitCode;

        }
    });

});

GeneralRe: Looping through elements, to find textbox, and get values Pin
Andrei Straut9-Aug-12 10:35
Andrei Straut9-Aug-12 10:35 
AnswerRe: Looping through elements, to find textbox, and get values Pin
Andy Brummer9-Aug-12 10:26
sitebuilderAndy Brummer9-Aug-12 10:26 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx9-Aug-12 16:54
professionaljkirkerx9-Aug-12 16:54 
GeneralRe: Looping through elements, to find textbox, and get values Pin
Andy Brummer10-Aug-12 4:56
sitebuilderAndy Brummer10-Aug-12 4:56 
GeneralRe: Looping through elements, to find textbox, and get values Pin
jkirkerx10-Aug-12 6:31
professionaljkirkerx10-Aug-12 6:31 
QuestionGet value from textbox created with createElement Pin
jkirkerx6-Aug-12 15:48
professionaljkirkerx6-Aug-12 15:48 
AnswerRe: Get value from textbox created with createElement Pin
BobJanova7-Aug-12 0:12
BobJanova7-Aug-12 0:12 
GeneralRe: Get value from textbox created with createElement Pin
jkirkerx7-Aug-12 6:24
professionaljkirkerx7-Aug-12 6:24 
AnswerRe: Get value from textbox created with createElement Pin
twseitex7-Aug-12 8:25
twseitex7-Aug-12 8:25 
GeneralRe: Get value from textbox created with createElement Pin
jkirkerx8-Aug-12 10:54
professionaljkirkerx8-Aug-12 10:54 
Questionadapt datatable jquery to jee application Pin
ahmadiss4-Aug-12 23:34
ahmadiss4-Aug-12 23:34 
AnswerRe: adapt datatable jquery to jee application Pin
Richard MacCutchan5-Aug-12 1:24
mveRichard MacCutchan5-Aug-12 1:24 
Questionshowmodaldialog return value undefined across domain Pin
Amr M. K.4-Aug-12 23:24
Amr M. K.4-Aug-12 23:24 
AnswerRe: showmodaldialog return value undefined across domain Pin
jkirkerx5-Aug-12 11:05
professionaljkirkerx5-Aug-12 11:05 
GeneralRe: showmodaldialog return value undefined across domain Pin
Amr M. K.6-Aug-12 22:05
Amr M. K.6-Aug-12 22:05 
AnswerRe: showmodaldialog return value undefined across domain Pin
BobJanova5-Aug-12 23:43
BobJanova5-Aug-12 23:43 
GeneralRe: showmodaldialog return value undefined across domain Pin
Amr M. K.6-Aug-12 21:26
Amr M. K.6-Aug-12 21:26 

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.