I am using the following code to call an onblur and onfocus effect to enable the default value in the textbox form to disappear when the user cluicks in the box and reappear when the user clicks out of it without writing anything.
So far, so good. However, I want to prevent this default text from being submitted and/or processed if the user doesn't write anything in this textarea.
Any ideas how I can do this?
Thanks!
<script><!--
function eFocus(field){
if (field.value == field.defaultValue){
field.value ='';
}
field.className="BEmail"
}
function eBlur(field){
if (field.value == ''){
field.value = field.defaultValue;
field.className="REmail";
}else{
field.className="BEmail";
}
}
// --></script>
<body>
<li class="mainForm" id="fieldBox_6">
<label class="formFieldQuestion">Any further information: </label><textarea Class="REmail" onfocus="eFocus(this)" onblur="eBlur(this)" name=comments id=field_6 rows=10 cols=40 Class="REmail" Class="REmail">If you have any questions, comments or need advice - tell us here.</textarea>
</body>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi there,
I am using the following code to call an onblur and onfocus effect to enable the default value in the textbox form to disappear when the user cluicks in the box and reappear when the user clicks out of it without writing anything.
So far, so good. However, I want to prevent this default text from being submitted and/or processed if the user doesn't write anything in this textarea.
Any ideas how I can do this?
Thanks!
<script><!--
function eFocus(field){
if (field.value == field.defaultValue){
field.value ='';
}
field.className="BEmail"
}
function eBlur(field){
if (field.value == ''){
field.value = field.defaultValue;
field.className="REmail";
}else{
field.className="BEmail";
}
}
// --></script>
<body>
<li class="mainForm" id="fieldBox_6">
<label class="formFieldQuestion">Any further information: </label><textarea Class="REmail" onfocus="eFocus(this)" onblur="eBlur(this)" name=comments id=field_6 rows=10 cols=40 Class="REmail" Class="REmail">If you have any questions, comments or need advice - tell us here.</textarea>
</body>