IE problems: can't get combobox value/cached results

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SagarDoke
    New Member
    • Feb 2008
    • 24

    IE problems: can't get combobox value/cached results

    I have written one code for combobox in html.

    [HTML]<label style="margin-left:450px" for="clientName ">Client Name:</label>

    <Select style="margin-left:31px" name="clientNam e" id="clientName " onchange = 'getCallCenter( )'></Select>[/HTML]

    Now javascript ,

    [CODE=javascript]function getCallCenter()
    {
    var clientID=docume nt.getElementBy Id('clientName' ).value;
    alert(clientID) ;
    }[/CODE]

    now problem is, i am getting the value in firefox. but in ie its showing blank.
    Whats the problem i am not getting? please help me to solve this problem.
    Is there any other way to get the value in ie?
    Last edited by gits; Apr 23 '08, 07:21 AM. Reason: added code tags
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    i think that i remember that IE has some problems with identical id and name attribs ... may be you could use:

    [HTML]onchange = 'getCallCenter( this);'[/HTML]
    in your select and then:

    [CODE=javascript]function getCallCenter(n ode) {
    alert(node.valu e);
    }
    [/CODE]this refers to the node itself in this case and should work for you.

    kind regards

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Originally posted by SagarDoke
      i am getting the value in firefox. but in ie its showing blank.
      Whats the problem i am not getting? please help me to solve this problem.
      Is there any other way to get the value in ie?
      Maybe you haven't set the values for the option elements.

      Comment

      • SagarDoke
        New Member
        • Feb 2008
        • 24

        #4
        Originally posted by acoder
        Maybe you haven't set the values for the option elements.
        Thanks,
        i'm getting values.

        But now another problem is there in ie.
        For yui datatable, values are not getting updated dynamically. I think cache problem is there. Because after deleting the history(cache) its working. Same code is working on firefox without deleting history(cache). Is there any way to reset the cache for ie in javascript or in yui?

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          To avoid caching problems in IE, make the URL unique, e.g.
          [code=javascript]xmlhttp.open("G ET","ajax.php?t est=blah&d="+ne w Date().getTime( ),true);[/code]

          Comment

          • SagarDoke
            New Member
            • Feb 2008
            • 24

            #6
            Originally posted by acoder
            To avoid caching problems in IE, make the URL unique, e.g.
            [code=javascript]xmlhttp.open("G ET","ajax.php?t est=blah&d="+ne w Date().getTime( ),true);[/code]
            but i'm have to use yui. for that i have written a code like this

            [code=javascript]

            var callback =
            {
            success : openresultSet,
            failure : dt_openALL.onDa taReturnInitial izeTable,
            scope : dt_openALL,
            cache : false
            };

            ds_openAll.send Request("name=g etAllClosed&Ski ll_ID_List="+sk Ids+"&UID=" + uid,callback);[/code]
            Last edited by acoder; Apr 29 '08, 10:14 AM. Reason: fixed code tag

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              So, just add it to the end of the parameters, e.g.
              [code=javascript]ds_openAll.send Request("name=g etAllClosed&Ski ll_ID_List=" + skIds + "&UID=" + uid + "&d=" + new Date().getTime( ),callback);[/code]

              Comment

              • SagarDoke
                New Member
                • Feb 2008
                • 24

                #8
                Originally posted by acoder
                So, just add it to the end of the parameters, e.g.
                [code=javascript]ds_openAll.send Request("name=g etAllClosed&Ski ll_ID_List=" + skIds + "&UID=" + uid + "&d=" + new Date().getTime( ),callback);[/code]
                Ok. Now its working fine. Thank you very much.

                Comment

                • acoder
                  Recognized Expert MVP
                  • Nov 2006
                  • 16032

                  #9
                  You're welcome! Post again if you have more questions.

                  Comment

                  Working...