OUTLINE
• Changing a label dynamically
• Manipulating form elements
• Intrinsic java script functions
• Disabling elements
• Read only elements
CHANGING LABELS DYNAMICALLY
• You can relabel an element when its purpose has already been served
• You can relabel an element and change any of its attributes by using a
java script function
• E.g.
Element_name.value = new_value;
MANIPULATING FORM ELEMENTS
• You can manipulate elements on a form after the user clicks the Submit
button and before the form is actually submitted to the server side
application
• You can validate the information on the form before submitting
• You can autofill the form field values before submitting
INTRINSIC JAVA SCRIPT FUNCTIONS
• JavaScript has a special set of functions called intrinsic functions that
mimic actions of the Submit button and Reset button of the form
• You don’t define intrinsic function, because JavaScript defines the
function for you
• However, you can call an intrinsic function
• An intrinsic function is often used to replace the Submit button and the
Reset button with your own graphical images, which are displayed on the
form in place of these buttons
DISABLING ELEMENTS
• Form with some disabled elements prevents the user from entering
information into the element
• A disabled element appears on the form, but no information can be
entered into the element until it is enabled
• JavaScript function can be used to enable or disable the elements on
the form
• E.g.
element_name.disabled = false;
element_name.disabled = true;
READ ONLY ELEMENTS
• If readonly attribute of an element is set to true, then no one, including
java script function can change the value of that element
• You can change the value of readonly attribute from within your java
script function
• E.g.
element_name.readonly = false;
element_name.readonly = true;