SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opening new window, with value from array form field

    I am trying to open a window, with a url, and parameter from array form field. Here is the code:

    <input type="text" name="parameter[1]" value="1223344"><input type="button" value="Check ID" onclick="window.open('http://www.website.com/profile.php?sid=&MemberID=' + document.MainForm.parameter[1].value)">

    I am getting that document.MainForm.parameter.1 is null or not an object.

    How can I properly make javascript recorgenize the field?

  2. #2
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change

    document.MainForm.parameter[1].value

    to

    document.MainForm.elements['parameter[1]'].value
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  3. #3
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, that works!


Bookmarks

Posting Permissions

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