Category Archives: HTML / CSS

Get And Set The Selected Value In a Combobox

Just use the selectedIndex property.

Posted in HTML / CSS, Javascript | Leave a comment

Conditional Form Submit (With or Without AJAX)

Without AJAX: <script> function validateForm() { if (ok) { // everything’s OK, we can submit the form return true; } else { return false; } } </script> <form onSubmit=”return validateForm()”> <input type=”submit” value=”Submit”> </form> /////////////////////////////////////////////////////// With AJAX: If submitting the … Continue reading

Posted in AJAX, HTML / CSS, Javascript | Leave a comment

Howto Dynamically Insert Javascript And CSS

Howto_Dynamically_Insert_Javascript_And_CSS.html

Posted in HTML / CSS, Javascript | Leave a comment

Javascript Get The Checked Values For Radio Buttons and Checkbox

Radio button: HTML: <input type=”radio” id=”myradio” name=”myradio”> Javascript: var myradio = document.getElementsByName(‘myradio’); var choice = getRadioCheckedValue(myradio); // Given a radio button obj, return the selected value function getRadioCheckedValue(radioObj) { if(!radioObj) return “”; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) … Continue reading

Posted in HTML / CSS, Javascript | Leave a comment