Basic ASP/Javascript

Discussion in 'ASP General' started by John, Jul 13, 2006.

  1. John

    John Guest

    Can anyone please advise, i have a couple of functions.

    The first reads an array and calls the second function, that is suppose to
    check the value entered into a field and return it's length, it does 't it
    return the field name.How can i pass the value in the field rather than the
    field name ?

    Thanks

    John

    function CheckWholeForm(theform) {
    var why="";

    var frmchk;

    for(x=0;x<jsRow;x++) {
    frmchk = "theform." + JSArray[0][x] + ".value";
    why += CheckStringLength(frmchk,JSArray[0][x],JSArray[1][x]);
    }

    if (why != "") {
    alert (why);
    return false;
    }
    return true;
    }
    -------------------

    function CheckStringLength(strng, nme, sz) {
    var why = "";

    if (strng.length > sz) {
    why = "The maximum number of characters you can enter in the field " + nme
    + " is " + sz + " (" + strng.length + ") \n Please reduce the size of this
    field and resubmit \n" + strng + "\n";
    }
    return why;
    }
    ---------------------------

    jsRow = 10
    JSArray[0][0] = "Competitiontxt";
    JSArray[0][1] = "Mounting_Methodtxt";
    JSArray[0][2] = "cttxt";
    JSArray[0][3] = "Tile Materialtxt";
    JSArray[0][4] = "Ceiling Typetxt";
    JSArray[0][5] = "Grid Heighttxt";
    JSArray[0][6] = "Void_Depthtxt";
    JSArray[0][7] = "Void_restrictiontxt";
    JSArray[0][8] = "Wall_Detailtxt";
    JSArray[0][9] = "UseStandardtxt";
    JSArray[1][0] = "510";
    JSArray[1][1] = "2";
    JSArray[1][2] = "2";
    JSArray[1][3] = "2";
    JSArray[1][4] = "2";
    JSArray[1][5] = "2";
    JSArray[1][6] = "100";
    JSArray[1][7] = "100";
    JSArray[1][8] = "100";
    JSArray[1][9] = "100";
    John, Jul 13, 2006
    #1
    1. Advertising

  2. John wrote:
    > Can anyone please advise, i have a couple of functions.
    >

    Please post this to a client-side scripting newsgroup such as
    microsoft.public.scripting.jscript.

    Just because code appears in an asp page does not make it an asp
    (server-side code) issue. It's a simple litmus test:
    eliminate the server-side asp code from the page and change the page's
    extension to .htm. Does your page still exhibit the behavior you are asking
    about? If so, then it's a client-side issue, not an asp issue.
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Jul 13, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newbie

    Basic question b/w ASP & ASP .NET

    Newbie, Jul 29, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    1,836
    Steve C. Orr, MCSD
    Jul 30, 2003
  2. Engineer
    Replies:
    6
    Views:
    605
    Jeremy Bowers
    May 1, 2005
  3. Replies:
    0
    Views:
    417
  4. Sasquatch
    Replies:
    2
    Views:
    444
    Sasquatch
    Oct 4, 2006
  5. Ryan Liu
    Replies:
    3
    Views:
    2,212
    Ryan Liu
    Mar 27, 2009
Loading...

Share This Page