change type of input field with jQuery

$(document).ready(function() { // #login-box password field $(‘#password’).attr(‘type’, ‘text’); $(‘#password’).val(‘Password’); }); This is supposed to change the #password input field (with id=”password”) that is of type password to a normal text field, and then fill in the text “Password”. It doesn’t work, though. Why? Here is the form: <form enctype=”application/x-www-form-urlencoded” method=”post” action=”/auth/sign-in”> <ol> <li> <div class=”element”> … Read more

Phone: numeric keyboard for text input

Is there a way to force the number keyboard to come up on the phone for an <input type=”text”>? I just realized that <input type=”number”> in HTML5 is for “floating-point numbers”, so it isn’t suitable for credit card numbers, ZIP codes, etc. I want to emulate the numeric-keyboard functionality of <input type=”number”>, for inputs that … Read more

How do I make a text input non-editable?

So I have a text input <input type=”text” value=”3″ class=”field left”> Here is my CSS for it background:url(“images/number-bg.png”) no-repeat scroll 0 0 transparent; border:0 none; color:#FFFFFF; height:17px; margin:0 13px 0 0; text-align:center; width:17px; Is there a setting or a trick to this, I was thinking of doing a label instead but how about the styling. … Read more

What’s the proper value for a checked attribute of an HTML checkbox?

We all know how to form a checkbox input in HTML: <input name=”checkbox_name” id=”checkbox_id” type=”checkbox”> What I don’t know — what’s the technically correct value for a checked checkbox? I’ve seen these all work: <input name=”checkbox_name” id=”checkbox_id” type=”checkbox” checked> <input name=”checkbox_name” id=”checkbox_id” type=”checkbox” checked=”on”> <input name=”checkbox_name” id=”checkbox_id” type=”checkbox” checked=”yes”> <input name=”checkbox_name” id=”checkbox_id” type=”checkbox” checked=”checked”> <input … Read more