I have a problem using jQuery Validation forms where I want to put a Integer input only. For example, &lt;div class=&quot;form-group&quot;&gt;   &lt;label for=&quot;interval&quot; &gt;Interval&lt;/label&gt;   &lt;input name=&quot;interval&quot; type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;interval&quot;  &lt;/div&gt;  $(&quot;validation-form&quot;).validate({   rules: {     'interval': {       number: true,       required: true,     },  It works well, but it is a Float type because it can also take something like 5.6, but I want to have Integer type. The output should be:  Integer type is required.  How can I do that?
6818
Is there a quick way to set an HTML text input (&lt;input type=text /&gt;) to only allow numeric keystrokes (plus '.')?
62871
If my html looked like this:  &lt;td class="controlCell"&gt;     &lt;input class="inputText" id="SearchBag.CompanyName" name="SearchBag.CompanyName" type="text" value="" /&gt; &lt;/td&gt;   How could I select #SearchBag.CompanyName with JQuery? I can't get it to work and I fear it's the dot that's breaking it all. The annoying thing is that renaming all my id's would be a lot of work, not to mention the loss in readability.  Note: Please let's not start talking about how tables are not made for lay-outing. I'm very aware of the  and try hard to use it as much as possible.
22775
Is there a library or acceptable method for sanitizing the input to an html page?  In this case I have a form with just a name, phone number, and email address.    Code must be C#.  For example:  "&lt;script src='bobs.js'&gt;John Doe&lt;/script&gt;" should become "John Doe"
40474
I have a Python function that takes a numeric argument that must be an integer in order for it behave correctly. What is the preferred way of verifying this in Python?  My first reaction is to do something like this:  def isInteger(n):     return int(n) == n   But I can't help thinking that this is 1) expensive 2) ugly and 3) subject to the tender mercies of machine epsilon.   Does Python provide any native means of type checking variables? Or is this considered to be a violation of the language's dynamically typed design?  EDIT: since a number of people have asked - the application in question works with IPv4 prefixes, sourcing data from flat text files. If any input is parsed into a float, that record should be viewed as malformed and ignored.
36235
I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.  I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?  EDIT: The attribute filters allow you to select based on patterns of an attribute value.
117305
I have a textbox in Javascript. When I enter '0000.00' in the textbox, I want to know how to convert that to only having one leading zero, such as '0.00'.
17392
Which is better to do client side or server side validation?  In our situation we are using    jQuery and MVC.   JSON data to pass between our View and Controller.     A lot of the validation I do is validating data as users enter it. For example I use the the keypress event to prevent letters in a text box, set a max number of characters and that a number is with in a range.   I guess the better question would be, Are there any benefits to doing server side validation over client side?    Awesome answers everyone. The website that we have is password protected and for a small user base(&lt;50). If they are not running JavaScript we will send ninjas. But if we were designing a site for everyone one I'd agree to do validation on both sides.
101975
I'm building a plugin that has a meta box. Some of the fields in the meta box are required. Is using jQuery the only method for achieving this? Can I require that a field is filled in using PHP?
67748
I have a simple html block like:  &lt;span id="replies"&gt;8&lt;/span&gt;   Using jquery I'm trying to add a 1 to the value (8).  var currentValue = $("#replies").text(); var newValue = currentValue + 1; $("replies").text(newValue);   What's happening is it is appearing like:  81  then  811  not 9, which would be the correct answer.  What am I doing wrong?
44428
Is there any way with CSS to target all inputs based on their type? I have a disabled class I use on various disabled form elements, and I'm setting the background color for text boxes, but I don't want my checkboxes to get that color.   I know I can do this with seperate classes but I'd rather use CSS if possible. I'm sure, I can set this in javascript but again looking for CSS.  I'm targeting IE7+. So i don't think I can use CSS3.  Edit  With CSS3 I would be able to do something like?  INPUT[type='text']:disabled that would be even better get rid of my class altogether...  Edit  Ok thanks for the help! So here's a selector which modifies all textboxes and areas which have been disabled without requiring setting any classes, when I started this question I never thought this was possible...  INPUT[disabled][type='text'], TEXTAREA[disabled] {        background-color: Silver; }   This works in IE7
80880
My code:  a = '2.3'   I wanted to display a as a floating point value.  Since a is a string, I tried:  float(a)   The result I got was :  2.2999999999999998   I want a solution for this problem. Please, kindly help me.  I was following .
27187
Is there a way to convert a regular form and add placeholders with a module, or should this be done with a form template or with jQuery?
95520
I want to label a scale based on a variable value and I wrote a metapost code like this.  $ := 1; for i = -.3cm step .6cm until 3.6cm:     label.bot(str$,(i,-3.7cm));     $ := incr($); endfor;   It just labels "$" instead of its value. How to output the variables value?
28047
Is there any syntactical way in jQuery to define multiple CSS attributes without stringing everything out to the right like this:  $("#message").css("width", "550px").css("height", "300px").css("font-size", "8pt");   If you have, say, 20 of these your code will become hard to read, any solutions?  From jQuery API, for example, jQuery understands and returns the correct value for both   .css({ "background-color": "#ffe", "border-left": "5px solid #ccc" })    and   .css({backgroundColor: "#ffe", borderLeft: "5px solid #ccc" }).   Notice that with the DOM notation, quotation marks around the property names are optional, but with CSS notation they're required due to the hyphen in the name.
38027
I need a way to determine the type of an HTML element in JavaScript. It has the ID, but the element itself could be a &lt;div&gt;, a &lt;form&gt; field, a &lt;fieldset&gt;, etc. How can I achieve this?
92276
I have a form that is dynamically generated, and has dynamically generated id's (and potentially classes). The forms are the same but they have the related id tacked on to the end.  How can I select each set of inputs and apply code to each one?  I was experimenting with $('input[id^=@id_airline_for_]') but could not get it to fly. I suspect I am missing some fundamental jQuery knowledge that is holding me back since I am sure this is a common problem with dynamic forms.   &lt;form method='POST'&gt;     &lt;label for="id_airline_for_8"&gt;Airline&lt;/label&gt;:     &lt;input id="id_airline_for_8" class="arrival_transfer_toggle_8" type="text" maxlength="30" name="airline_for_8"/&gt;     &lt;label for="id_flight_number_for_8"&gt;Flight Number&lt;/label&gt;:     &lt;input id="id_flight_number_for_8" class="arrival_transfer_toggle_8" type="text" maxlength="30" name="flight_number_for_8"/&gt;      &lt;label for="id_airline_for_17"&gt;Airline&lt;/label&gt;:     &lt;input id="id_airline_for_17" class="arrival_transfer_toggle_17" type="text" maxlength="30" name="airline_for_17"/&gt;     &lt;label for="id_flight_number_for_17"&gt;Flight Number&lt;/label&gt;:     &lt;input id="id_flight_number_for_17" class="arrival_transfer_toggle_17" type="text" maxlength="30" name="flight_number_for_17"/&gt;      -- snip --  &lt;/form&gt;   EDIT: I should update that i want to be able to perform some action when the input is clicked but only for classes with a matching id at the end.  To make it easy, lets say I want all inputs with a matching id at the end of the #id to disappear when one is clicked (just for arguments sake).
77376
var i : integer;  i := 1234567;   Given the above, I want the string "1,234,567" as output (assuming UK locale). IntToStr just gives me "1234567". I'm sure there's a one-liner for this, but I can't find it...