SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery UI chained select-menu. Form resets when button is clicked

    I am using a chained select-menu to guide the visitor trough some questions. This works like a charm, however, in the end the user has to click a button to send all values to a PHP-script. This also works without a problem, however, when the page reloads (because the button sends the form to the same page), all fields are hidden again and this is not what i want.

    I would like the chained selection menu's to be shown when items in them are "selected" when the page reloads. Using PHP i simply test if a field was selected and add that status to the select-menu. But they remain hidden until you manually select everything again.

    I think it's just a minor adjustment in the JS-part. But my limited knowledge of JS leaves me without a solution.

    jsFiddle
    Chainedselection script
    jQuery UI and selectmenu

    I also posted this question on StackOverflow, but lately I am not getting any answers for any questions on this site. So I am trying it elsewhere as well. I ofcoarse will post the answer wherever someone helps me.

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it's solved: http://jsfiddle.net/kLDcL/2/

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One more question. I would like the button to appear when <select name="map[]"> and <select name="mapb[]"> are both set. Could anyone help me out? See fiddle in post above.

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2006
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone?


Tags for this Thread

Bookmarks

Posting Permissions

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