Quote:
Originally Posted by hasano
im only submiting in the javascript for testing reasons, but when this works ill have to check whether any of the inputs is empty, if it is then i have to fire an alert message else i will submit the form.
Do you have any idea how to check a form input if it is empty and thus display a prompt or alert message.???
For this, you can still use the submit button, but also include an onsubmit in your form tag:
[HTML]<form name="form" action="..." onsubmit="return yourErrorCheck();">[/HTML]
Your error check function will check for errors. If there are any errors it will return false (stopping submit), otherwise return true (the form is submitted).
To check if a form input is empty, you can use the following code:
- if (document.form.inputname.value == "") {
-
alert("Please enter a value for blah blah...");
This is Javascript code, but since you're using Coldfusion, I've answered here.
If you still have problems, post again.