SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript and the Select object

    I am having a serious problem getting a 'select' to work. I have created a;

    function getData(dataSource, divID)

    which uses the XMLHttpRequestObject. I know it works, cause it works with the 'button' form quite nicely. I am trying to use it in a 'select' form as well.

    <select name="SelectURL" onchange="getData
    ('document.location.href=document.nav.SelectURL.options
    [document.nav.SelectURL.selectedIndex].value' 'targetDiv2')">

    As you can see I am trying to use the DOM to get the data from the options. This works fine when simply navigating to a new page, however where the real problem occurs is when trying to get it to output to the same page, hence the 'targetDiv2'.

    So, when the select form changes, I want the 'getData' function to run, grab an html page (text, xml doesnt matter) from the options, and display it in the same page there at the targetDiv2.

    I use this with buttons, and it works great, but for some reason I canna' get it to work right with select. Any help is appreciated in advance. Thanks.

  2. #2
    SitePoint Member
    Join Date
    Feb 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anybody have any answers for this? Would really appreciate it.

    -thanks


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
  •