Results 1 to 5 of 5
  1. #1
    Join Date
    May 2004
    Posts
    73

    Arrow Unanswered: Some help with an SQL statement please?

    I have this java code for an autotab between the area code, prefix, and suffix of a telephone number. the problem is how do I combine the three texboxes into one field insert as a completed number?

    Thanks in advance.

    THE CODE:

    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var isNN = (navigator.appName.indexOf("Netscape")!=-1);
    function autoTab(input,len, e) {
    var keyCode = (isNN) ? e.which : e.keyCode;
    var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
    if(input.value.length >= len && !containsElement(filter,keyCode)) {
    input.value = input.value.slice(0, len);
    input.form[(getIndex(input)+1) % input.form.length].focus();
    }
    function containsElement(arr, ele) {
    var found = false, index = 0;
    while(!found && index < arr.length)
    if(arr[index] == ele)
    found = true;
    else
    index++;
    return found;
    }
    function getIndex(input) {
    var index = -1, i = 0, found = false;
    while (i < input.form.length && index == -1)
    if (input.form[i] == input)index = i;
    else i++;
    return index;
    }
    return true;
    }
    // End -->
    </script>

    <center>
    <form>
    <table>
    <tr>
    <td>Phone Number : <br>
    1 - (
    <small><input onKeyUp="return autoTab(this, 3, event);" size="4" maxlength="3"></small>) -
    <small><input onKeyUp="return autoTab(this, 3, event);" size="4" maxlength="3"></small> -
    <small><input onKeyUp="return autoTab(this, 4, event);" size="5" maxlength="4"></small>
    </td>
    </tr>
    </table>
    </form>
    </center>

  2. #2
    Join Date
    May 2004
    Posts
    73
    Can anybody help me please?

  3. #3
    Join Date
    Feb 2004
    Posts
    492
    Sure, but where's your sql-statement?

  4. #4
    Join Date
    May 2004
    Posts
    73
    thats what i need help with? 3 text field combined into one database field

    field1 = Request.Form("tele_area_code")
    field2 = Request.Form("tele_prefix")
    field3 = Request.Form("tele_suffix")

    field1 + field2 + field3 = field4????????????????

    SQL = "INSERT INTO tbl_customer (field4) VALUES ('"_&
    field4&"'')"
    Last edited by X-Centric; 01-14-05 at 13:22.

  5. #5
    Join Date
    Feb 2004
    Posts
    492
    Not an expert in this area, but, I'd go for a submit button which would do a post -method on the server (servlet/vbscript/ejb) which on it's turn could do the checking/concatting/inserting of the values.

    Is this the right forum?

    Usually it's someting like:
    field4 = field1 + field2 + field3
    Last edited by Kaiowas; 01-14-05 at 13:26.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •