The examples on this page illustrate common JavaScript that you can perform in any particular JSP page.
The following example provides developers a way to add their own function to perform form validation on submission:
<script language="JavaScript" type="text/javascript">
var form = document.forms['SOME_FORM_NAME'];
form.onsubmit=function(){ return customFormValidation(this); };
populateForm(form);
</script>
The following example simulates a form submission through a button call, which causes the panel to be redisplayed:
<SCRIPT language="JavaScript" type="text/javascript">
function submitRefresh()
{
var form = document.forms['SOME_FORM_NAME'];
disableFormButtons(form);
addFormField(form,'hidden','refreshButton','refreshButton');
setTimeout("form.submit()", 500);
}
</script>