Jump to content

Error messages


ShaolinF

Recommended Posts

You could also do it with Javascript (I would do it with PHP too if you were going to do it with javascript):

 


<script language="javascript">
<!--
function Submitted(form) {
if(form.textbox.length < 1) {
alert('Please enter something in the textarea.');
return false;
}
return true;
//not sure if textbox.length is the right format.... I don't use javascript to validate forms very often
//also, you could alter a div or just plain write something if it failed instead of alerts, which are like insanely annoying to me
}
//-->
</script>

<form action="" method="POST" onsubmit="return Submitted(this);">
<textarea name='textbox' id='textbox'>

</textarea>
</form>

Link to comment
https://forums.phpfreaks.com/topic/62339-error-messages/#findComment-310217
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.