Ask a Question related to Dreamweaver AppDev, Design and Development.
-
samkry #1
contraints on db
Hi..
i have a constraint on my db that allowed only certain values to be inserted into the table, so how can I put in my page to alert user that they have putting the wrong values in the database??
samkry Guest
-
greekchild #2
Re: contraints on db
Hi, You need to use javascript or vbscript. When some clicks the submit button
you can call a function to check the values on the form. At the top of your
code put in some javascript. This is an example. <script
type='text/javascript' language='JavaScript'> <!-- function validate(form) {
if ( document.form1.chk_male.checked == false &&
document.form1.chk_female.checked == false ) { alert ('You must choose at
least one gender!'); return false; } else { // return true; } if (
document.form1.chk_vod.checked == false &&
document.form1.chk_o2.checked == false &&
document.form1.chk_met.checked == false ) { alert ('You must choose at
least one operator !'); return false; } else { return true; } }
//--> </script> Then, go to the code where you submit button is and add
in the following onSubmit='return validate(this);' hope it helps
greekchild Guest



Reply With Quote

