page refresh with url params

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmorand
    New Member
    • Sep 2007
    • 219

    page refresh with url params

    Ok, I'm very very new to javascript and am trying to use it with some coldfusion I'm doing.

    I'm trying to have a page refresh when a user changes a selection in a drop down list.

    Here is the code I have in my HEAD section:

    [code=javascript]
    function readDateTime(){
    var n = datetimeFrm.ed_ dt.selectedInde x; //get selected index value
    var val = datetimeFrm.ed_ dt[n].text; //get selected value
    alert('You entered: ' + val);
    //window.location .reload();
    datetimeFrm.tes tingvalues.valu e = val;
    alert(datetimeF rm.testingvalue s.value);

    }
    </script>
    [/code]
    I have it setup to reload, but I want to pass the "val" in the url.
    I want it to be http://www...com?datet ime=val
    What syntax do I need to use to load a page so I can pass these values?
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5388

    #2
    hi ...

    try to use:

    [CODE=javascript]window.location .href = window.location .href + '?datetime=' + val;[/CODE]
    instead of reload ...

    kind regards

    Comment

    • dmorand
      New Member
      • Sep 2007
      • 219

      #3
      Originally posted by gits
      hi ...

      try to use:

      [CODE=javascript]window.location .href = window.location .href + '?datetime=' + val;[/CODE]
      instead of reload ...

      kind regards
      Ok cool, let me give that a try

      Comment

      • dmorand
        New Member
        • Sep 2007
        • 219

        #4
        Originally posted by dmorand
        Ok cool, let me give that a try
        Sweet it worked!! Many thanks!

        Comment

        • gits
          Recognized Expert Moderator Expert
          • May 2007
          • 5388

          #5
          glad to hear that you got it working ... post back to the forum anytime you have more questions ...

          kind regards

          Comment

          Working...