×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    17

    Error while selecting an item from dropdown list

    Hello,

    I am getting the following error in console log when selecting an item from a dropdown list.

    TypeError: Result of expression 'selects[k].options[selects[k].selectedIndex]' [undefined] is not an object.

    I am using Nokia Web tools 1.5 and here is my code.

    <select onchange="stateSelected();">
    <option value=1>Value1</option>
    <option value=2>Value2</option>
    <option value=3>Value3</option>
    </select>


    The function has just an alert inside.

    Please let me know if you have seen this error before.

    Regards,
    Surya

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: Error while selecting an item from dropdown list

    Hi,

    You could try alternative method:
    Code:
    var selList = document.getElementById("selectList");
    selList.options[selList.selectedIndex].value
    In addition Alert is not supported, so you might want to use console.log in simulator.

    Br,
    Ilkka

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    17

    Re: Error while selecting an item from dropdown list

    Thank you Ilkka, I am now using console.log.

    But I am afraid this suggestion may not resolve the issue. The problem occurs when I assign a function to handle onchange event. The onchange event handler is not called when selection changes, but error appears in log.

    Rg,
    Surya

Similar Threads

  1. dropdown list
    By koraykayir in forum Symbian User Interface
    Replies: 3
    Last Post: 2010-11-02, 15:56
  2. Can I get dropdown list ID or name?
    By bartx in forum Symbian
    Replies: 1
    Last Post: 2009-12-09, 18:03
  3. how to implenment dropdown list ?
    By tlr in forum Symbian User Interface
    Replies: 9
    Last Post: 2009-04-15, 08:09
  4. how to show a new form while selecting a list item...
    By josephcarmel in forum Mobile Java General
    Replies: 2
    Last Post: 2009-03-07, 08:12
  5. Dropdown List or wheels ?
    By PopAndDestroy in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-02-08, 17:31

Posting Permissions

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