How to open a new window on form submit

No need for Javascript, you just have to add a target=”_blank” attribute in your form tag. <form target=”_blank” action=”http://example.com” method=”post” id=”mc-embedded-subscribe-form” name=”mc-embedded-subscribe-form” class=”validate” >

Multiple radio button groups in one form

Set equal name attributes to create a group; <form> <fieldset id=”group1″> <input type=”radio” value=”value1″ name=”group1″> <input type=”radio” value=”value2″ name=”group1″> </fieldset> <fieldset id=”group2″> <input type=”radio” value=”value1″ name=”group2″> <input type=”radio” value=”value2″ name=”group2″> <input type=”radio” value=”value3″ name=”group2″> </fieldset> </form>

Best Practice: Access form elements by HTML id or name attribute?

Give your form an id only, and your input a name only: <form id=”myform”> <input type=”text” name=”foo”> Then the most standards-compliant and least problematic way to access your input element is via: document.getElementById(“myform”).elements[“foo”] using .elements[“foo”] instead of just .foo is preferable because the latter might return a property of the form named “foo” rather than … Read more

How to disable all inside a form with jQuery?

In older versions you could use attr. As of jQuery 1.6 you should use prop instead: $(“#target :input”).prop(“disabled”, true); To disable all form elements inside ‘target’. See :input: Matches all input, textarea, select and button elements. If you only want the <input> elements: $(“#target input”).prop(“disabled”, true);

Can you have multiline HTML5 placeholder text in a ?

For <textarea>s the spec specifically outlines that carriage returns + line breaks in the placeholder attribute MUST be rendered as linebreaks by the browser. User agents should present this hint to the user when the element’s value is the empty string and the control is not focused (e.g. by displaying it inside a blank unfocused … Read more

Disabled form fields not submitting data [duplicate]

As it was already mentioned: READONLY does not work for <input type=”checkbox”> and <select>…</select>. If you have a Form with disabled checkboxes / selects AND need them to be submitted, you can use jQuery: $(‘form’).submit(function(e) { $(‘:disabled’).each(function(e) { $(this).removeAttr(‘disabled’); }) }); This code removes the disabled attribute from all elements on submit.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)