473,388 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

select tag will not reset to default

I have made mant types of fields in a form and can reset it with no problems but the select field will not reset
Acutally it does reset but it will not return to the default value
can anyone tell me where i am going wrong
here is the code

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. <title>Starter Page</title>
  5.  
  6. <link href="jquery-mobile/jquery.mobile-1.2.0.min.css" rel="stylesheet" type="text/css">
  7. <script src="jquery-mobile/jquery-1.8.3.min.js" type="text/javascript"></script>
  8. <script src="jquery-mobile/jquery.mobile-1.2.0.min.js" type="text/javascript"></script>
  9.  
  10.  
  11.  
  12.  
  13. <script language="javascript" type="text/javascript">
  14.  
  15. function formReset(){
  16.         $('#frm1').get(0).reset(); 
  17.         }
  18.    </script>
  19.  
  20. </head>
  21. <body>
  22.  
  23. <div data-role="page" id="stater_page">
  24.  
  25.     <div data-role="header" data-position="fixed" >
  26.                 <h1>City</h1>
  27.     </div><!--End of header div-->
  28.  
  29.     <div data-role="content">
  30.  
  31.         <form id="frm1">
  32.              <div id="selection">
  33.                 <label for="selectmenu" class="select">Choose City:</label>
  34.                 <select name="choice" data-mini="true" class="select-btn-font" id="choice">
  35.                     <option value="" selected="selected">Choose City</option>
  36.                     <option value="1">Los Angeles</option>
  37.                                         <option value="2">San Diego</option>
  38.                                         <option value="3">San Fransisco</option>
  39.                 </select>
  40.               </div>
  41.                 <input name="chg" type="number" class="input-font" id="chg" value="" data-mini="true" />
  42.                 <input type="reset" onclick="reset()" value="ResetForm"/>
  43.         </form>
  44.  
  45.     </div><!--End of content div-->
  46.  
  47.     <div class="text-center" data-role="footer" data-position="fixed">
  48.         City Guide &copy; 2012
  49.     </div><!--End of footer div-->
  50.  
  51. </div><!--End of Starter Page-->
  52.  
  53. </body>
  54. </html>
Jan 4 '13 #1
1 1962
Dormilich
8,658 Expert Mod 8TB
since you use a reset button, drop that event, it does nothing other than the reset button itself. … and it works for me.
Jan 4 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Ken | last post by:
How can I reset the initial form variables that are set with session statements when clicking on a button? I tried this but the function was not called: <?PHP function reset_form($none) {...
1
by: Steve Jorgensen | last post by:
An Access database connected to a PostgreSQL back-end. Sometimes, when I close a form, i get a message saying that the action will reset the current code in break mode. The front-end literally...
0
by: YFS DBA | last post by:
I'm getting an error message when I open queries then try to close them: "This action will reset the current code in break mode" Clicking on 'Yes' just brings up the same message. If I change...
1
by: PeteCresswell | last post by:
I'm working on a new report in an MS Access DB. The first anomaly was a message "This action will reset the current code in break mode." when the report was run. Seems TB something about my...
10
by: WindAndWaves | last post by:
Hi Gurus Whenever I start making changes in VB (without having anything open), the first time after opening the application, i will get the following error: This will reset your project do you...
7
by: PeteCresswell | last post by:
I don't *think* anything's running.... I haven't interrupted the code or anything. But the message seems to imply that some process really is running. Anybody been here?
3
by: Xarky | last post by:
Hi, I have a page with 2 textboxes(Name and Surname) and two buttons(Submit and Reset). Now I have set the tab for them 1 Name 2 Surname 3 Submit 4 Reset
1
by: Jake Barnes | last post by:
Imagine I've a function called suprise and I've a link called goSomewhereCool and I do this: document.getElementById('goSomewhereCool').onclick = surprise; Now later I want to reset the...
1
by: artev | last post by:
if in a page I have a search form, where want use metho reset() for reset default value I notice that after a research, for the method, the default values isn't more the initially load form but...
6
by: gritsman | last post by:
I have the following bit of code. Around line 20 is the code I am using to 'unhide' various tables based upon a drop down selection. The problem I am running into is the tables are overlapping each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.