|
From: Jon O. <jon...@us...> - 2006-09-05 19:22:08
|
Update of /cvsroot/mxbb/core/templates/subSilver/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20813/templates/subSilver/admin Modified Files: mx_blockcp_admin_body.tpl Log Message: JS bugs... Index: mx_blockcp_admin_body.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/admin/mx_blockcp_admin_body.tpl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mx_blockcp_admin_body.tpl 5 Sep 2006 17:57:58 -0000 1.8 --- mx_blockcp_admin_body.tpl 5 Sep 2006 19:22:04 -0000 1.9 *************** *** 178,181 **** --- 178,207 ---- } + function checkForm(form) + { + var formErrors = ''; + + if (form.block_title.value.length < 2) + { + formErrors += "Fill out the block title\r\n"; + } + + if (formErrors && do_check) + { + do_check = false + alert(formErrors); + return false; + } + else + { + return true; + } + } + + function preFormCheck() + { + do_check = true; + } + </script> <!-- dynamic_select --> *************** *** 327,331 **** <tr> ! <td class="row1" height="25" align="center" colspan="2">{blockcp_general_adds.S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{blockcp_general_adds.S_SUBMIT}" class="mainoption" />{CANCEL}</td> </tr> </table> --- 353,357 ---- <tr> ! <td class="row1" height="25" align="center" colspan="2">{blockcp_general_adds.S_HIDDEN_FIELDS}<input onClick="preFormCheck()" type="submit" name="submit" value="{blockcp_general_adds.S_SUBMIT}" class="mainoption" />{CANCEL}</td> </tr> </table> *************** *** 407,411 **** <tr> ! <td class="row1" height="25" align="center" colspan="2">{blockcp_general.S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{blockcp_general.S_SUBMIT}" class="mainoption" />{CANCEL}</td> </tr> </table> --- 433,437 ---- <tr> ! <td class="row1" height="25" align="center" colspan="2">{blockcp_general.S_HIDDEN_FIELDS}<input type="submit" onClick="preFormCheck()" name="submit" value="{blockcp_general.S_SUBMIT}" class="mainoption" />{CANCEL}</td> </tr> </table> *************** *** 432,436 **** <tr> <td class="row1" colspan="2"> ! <form action="{S_ACTION}" method="post" name="post" onsubmit="return checkForm(this)"> <table width="100%" cellpadding="2" cellspacing="0" border="0" align="center"> <tr> --- 458,462 ---- <tr> <td class="row1" colspan="2"> ! <form action="{S_ACTION}" method="post" name="post"> <table width="100%" cellpadding="2" cellspacing="0" border="0" align="center"> <tr> *************** *** 468,472 **** <tr> <td class="row1" colspan="2" width="100%"> ! <form action="{S_ACTION}" method="post" onsubmit="return checkForm(this)"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"> <tr> --- 494,498 ---- <tr> <td class="row1" colspan="2" width="100%"> ! <form action="{S_ACTION}" method="post"> <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center"> <tr> |