Skip to main content
May 14, 2008
Question

Use a Jump Menu to Make Selection and stay on same page.

  • May 14, 2008
  • 1 reply
  • 420 views
I have a form that you select a ID from a drop down list click submit, and then are redirected back to the same page with the results of a query based on the selection from the drop down list. I want to change this so the user doesn't have to click submit... I want my drop down list to act as a jump menu. How do I get my dropdown list to act like a jump menu, which essentially submits the form, and posts the results below?
    This topic has been closed for replies.

    1 reply

    Inspiring
    May 15, 2008
    2 ways, both use javascript (you can't do it with just cf):

    1) add an onChange attribute to your select with 'this.form.submit()' as
    value. this will submit the form, refresh the page and show your results
    - just as if user clicked your 'submit' button. be careful, though, if
    you are checking for existence of the submit button in your action page
    - it won;t be there since it has not been clicked.
    2) you can also employ some ajax features to submit your form
    asynchronously, 'behind the scenes', and show results without refreshing
    the page. CF8 has built-in ajax js functions and tags to do it,
    otherwise look into ajaxcfc by rob gonda or jQuery or other js framework
    that has these features.

    hth


    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/