www.webdeveloper.com
Results 1 to 5 of 5

Thread: AutoSubmit Drop Down Without Page Refresh

  1. #1
    Join Date
    Jul 2007
    Posts
    461

    AutoSubmit Drop Down Without Page Refresh

    Hi I have a drop down that autosubmits when selected.

    What would be the best way to change this code so the page doesn't refresh?

    Thank you!

    Code:
    <select name='image_selector' "this.form.submit();">
    <option></option>
    </select>

  2. #2
    Join Date
    Aug 2008
    Posts
    36
    learn php forms.

  3. #3
    Join Date
    Jul 2009
    Posts
    22
    I think theres an atribute missing in there...
    I think you should use the atribute: onchange. Like this:
    HTML Code:
    <select name='image_selector' onchange="this.form.submit();">
    <option></option>
    </select>

  4. #4
    Join Date
    Jul 2007
    Posts
    461
    Thanks.

  5. #5
    Join Date
    Jan 2009
    Posts
    3,346
    To prevent a page refresh on submit you'll need to use AJAX. The code you have above only submits whatever form that field is part of to wherever the action attribute points. This will always cause a page refresh unless you use AJAX to retrieve the results and make the appropriate changes to the page based on the returned data from the "submit".

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles