Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    input with [] in name

    Code:
    <SCRIPT LANGUAGE="JavaScript">writeSource("jscal1x");</SCRIPT>
    <INPUT TYPE="text" NAME="id[txt_1]" VALUE="" SIZE=25>
    <A HREF="javascript:cal1x.select(document.forms[0].id[txt_1],'anchor1x','MM/dd/yyyy');" NAME="anchor1x" ID="anchor1x">select</A>
    Problem - the name of the input field MUST be "id[txt_1]" as it is part of a php shopping cart that I don't want to mess with BUT the javascript won't run with an input name with []. Is there a way around??

    thanks!

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try: document.forms[0]['id[txt_1]']

  • #3
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    For further info (from Glenngv's sig) . . .

    Using Square Bracket Notation

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #4
    New to the CF scene
    Join Date
    Aug 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    delightful, thank you very much!


  •  

    Posting Permissions

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