dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Accessing form fields with brackets in name

  1. #1
    Join Date
    Nov 2002
    Posts
    1

    Accessing form fields with brackets in name

    I am trying to access a form field named "edbpriser[1]" with the following function:

    function returnkode (edbpriser_kode) {
    opener.document.kode.edbpriser[1].value = edbpriser_kode;
    }

    but I get this error:

    "opener.document.kode.edbpriser1 is not an object."

    Does anyone know what I'm doing wrong here?

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Your use of brackets in the field name is confusing the scripting engine. It thinks that you are trying to assign to the 'value' property of the object stored in the second element of the array 'opener.document.kode.edbpriser'. I'm afraid that you will need to rename your form controls.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles