jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.69k stars 2.4k forks source link

Jquery mobile popup not opening when having encoded parameters in url #8327

Closed 12amCoder closed 8 years ago

12amCoder commented 8 years ago

I couldn't get JM popup selectmenu working when having encoded parameters in url

Please see output: http://output.jsbin.com/dipowufame

After clicking Submit button, form is reloaded with get parameters, Clicking the select menu popup but nothing is appear.

Actual Result: image

Expected Result: expected

Jsbin: http://jsbin.com/dipowufame/edit?html,js,output

Found similar issue in stackoverflow http://stackoverflow.com/questions/28895092/jquery-mobile-popup-not-opening-when-encoded-parameters-in-url

marti1125 commented 8 years ago

Hi!! @uniqsign I suggest you use click event insteand of submit

or ajax event

  • any progress about this problem?
12amCoder commented 8 years ago

The problem is somehow caused by the encoded URL. It is not related to the click event. Example, the form is using GET method, so when submit it is passing the form element name and value to the URL.. After the page reload, popup can't be open anymore..

If I change it to ajax event it will solve the problem. However, the user couldn't copy and paste the link to others..

I think this is somehow a minor bug, if the URL doesn't contain any encoded url then it is working fine.

marti1125 commented 8 years ago

when submit a form the web will refresh it. maybe you can use localstorage http://stackoverflow.com/questions/1038572/easiest-way-to-persist-data-on-a-php-page

12amCoder commented 8 years ago

Oh, sorry what I mean is example

  1. I am creating list all transaction/results page.
  2. On top of the results table, there is a search/filter form (GET method) so user can filter the transactions by dates (textfield), categories (select dropdown with jquery mobile popup), etc.
  3. Let say the select drop down name is <select name="filter[category]">
  4. After user submit the form, the website will be reloaded and URL will change to results.php?filter%5Bname%5D=1&text=asdasd
  5. After that the select dropdown with jquery mobile popup will not open anymore.

Try this and you will know what I mean. http://output.jsbin.com/jeruyuhuqu

  1. Click select drop down (popup appear)
  2. Type something in the textfield
  3. click submit
  4. Website reloaded with GET parameter
  5. Try click the drop down again (Nothing appear)
marti1125 commented 8 years ago

Hi sry for delay!! try to add form action="/" how to save that data? results.php?filter%5Bname%5D=1&text=asdasd Is it return an array? results.php I think must be a jquery mobile page

apsdehal commented 8 years ago

Closing due to inactivity.