Forum Moderators: coopster
<button onClick='CheckFields()'
<?php if($DBConnect=="false")
{?> type=button name="Check"<?php}
else if($DBConnect=="True"){?>type=submit name="submit"<?php}?>> Enter Complaint</button>
Thanks
What I'm trying to do is, based on the result of the CheckFields function i.e. Value of DBConnect, I want to determine the type of button. If DBConnect = false then I want the button type to be button, if it's true I want the button type to be submit. I'd like to do some Client side checking of fields before going to the server side.
Does this expain it any better?
Thanks.
in the html:
<form name="test" id="test" action="index.html" method="POST"><button onclick="java_check(); return false;">Submit</button></form>
in javascript
function java_check()
{
//here you check everything, if finedocument.test.submit();
}
Hope it helps you somehow!
Best regards
Michal Cibor