Good afternoon.
I have editible input = text and I need to validate that txtCommentText is not null or spaces and I'm using the javascript below. I get "object expected" both when I blank out the text and when I leave it unedited during form submission. The alert statement below is returning a screen display that contains the correct values for the text box contents. The line that is highlighted in debug regarding "object expected" is: if ((lAction=="E"
&& (isWhiteSpace(document.frmCommentsAVED.txtCommentText.value))).
I would appreciate any insight that you can provide. Thank you very much.
------------------------------------
function ValidateFields()
{
// To check if Comment Text field is blank in Edit function.
alert(" txtCommentText value = " + document.frmCommentsAVED.txtCommentText.value ) ;
if ((lAction=="E"
&& (isWhiteSpace(document.frmCommentsAVED.txtCommentText.value)))
{
alert("The comment text field cannot be blank."
;
document.frmCommentsAVED.txtCommentText.focus() ;
return false ;
}
else
{
document.frmCommentsAVED.sAction.value = lAction+"SAVE" ;
return true ;
}
}
I have editible input = text and I need to validate that txtCommentText is not null or spaces and I'm using the javascript below. I get "object expected" both when I blank out the text and when I leave it unedited during form submission. The alert statement below is returning a screen display that contains the correct values for the text box contents. The line that is highlighted in debug regarding "object expected" is: if ((lAction=="E"
I would appreciate any insight that you can provide. Thank you very much.
------------------------------------
function ValidateFields()
{
// To check if Comment Text field is blank in Edit function.
alert(" txtCommentText value = " + document.frmCommentsAVED.txtCommentText.value ) ;
if ((lAction=="E"
{
alert("The comment text field cannot be blank."
document.frmCommentsAVED.txtCommentText.focus() ;
return false ;
}
else
{
document.frmCommentsAVED.sAction.value = lAction+"SAVE" ;
return true ;
}
}