Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6109853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:27:02+00:00 2026-05-23T14:27:02+00:00

I had created a select tag in html(SelectTest.html) with some values.What i’m trying to

  • 0

I had created a select tag in html(SelectTest.html) with some values.What i’m trying to do is after selecting any value from select tag, i need the page to be refreshed and pass the selected option as parameter to url.

Then i need to set this as selected value once the page is refreshed. I’m not sure whether this problem is related to jQuery mobile.

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" /> 
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.min.js"></script> 
<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script> 
<script type="text/javascript">
$(document).ready(function(){

    var param = window.location.search;

    if(param)
    {


      var indx = param.indexOf("=");

        //now get the value of selected type

        aval =param.substring(indx+1);

        $("#lang").val(aval);
    }   

    $("#lang").change(function(){

        var sel = $(this).val();


         window.location.href="SelectTest.html?type="+sel;

        });

});



</script>
<title>Insert title here</title>
</head>
<body>
<div data-role="page" id="home" data-theme="e"> 
<div data-role="header"> 
<h1>Test</h1> 
</div>
<div data-role="content" id="toi">

<div>
<label for="lang">Select Language</label>
<select name="language" id="lang">
<option value="en">English</option>
<option value="hi">Hindi</option>
<option value="sp">Spanish</option>
<option value="fr">French</option>
</select>
</div>



<div id="main">

</div>
</div>
</div> 
<div data-role="footer"> 
<h4>Test</h4> 
</div> 
</div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T14:27:02+00:00Added an answer on May 23, 2026 at 2:27 pm

    From the jquery mobile docs:

    If you manipulate a select via
    JavaScript, you must call the refresh
    method on it to update the visual
    styling. Here is an example:

    var myselect = $("select#foo");
    myselect[0].selectedIndex = 3;
    myselect.selectmenu("refresh");
    

    So basically you just need to call refresh on it. Does this help?

    For your code you can chain it like this

    $('#lang').val(aval).selectmenu("refresh");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had created one HTML page for my experiance. In this i had use
Assuming you had some kind of factory-created resource that would still belong to the
I had a plugin installed in Visual Studio 2008, and it created some extra
Is it possible to create a select tag from the models validation without having
I had created a zip file (together with directory) under Windows as follow (Code
Doug McCune had created something that was exactly what I needed ( http://dougmccune.com/blog/2007/05/10/analyze-your-actionscript-code-with-this-apollo-app/ )
I have a smallish utility library I made that I had created in TFS
If a set of controls on a WinForm have had DataBindings created and attached
In one of my builds for an iPhone app, I had inadvertently created a
I created a simple test page on my website www.xaisoft.com and it had no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.