Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

_onblur()

Status
Not open for further replies.

danalynn

Programmer
Jun 12, 2001
25
US
Private Sub EmpName_onblur()
If Trim(EmpName.Value) = " " Then
ErrorMsg.innerText = "Employee Name Required!"
Else
ErrorMsg.innerText = " "
End If
End Sub

I am creating a simple DHTML page. I keep getting a runtime error when i run the page. The runtime error is in the "errormsg.innertext = " ". can anyone help me why i am getting this?
 
What type of object is ErrorMsg? Post the HTML tag. IE:
<P ID=ErrorMsg>Im gonna change this.</P>

Also,
If Trim(EmpName.Value) = &quot; &quot; Then

FYI - This will never evaluate to True if you leave a space between the double quotes. It should be:
If Trim(EmpName.Value) = &quot;&quot; Then Jon Hawkins
 
<span ID-&quot;ErrorMsg&quot; align = &quot;left&quot; alt = &quot;Error Message here&quot;><font color=&quot;#ff0000&quot;>
<p>Error Message!</font><br></p></span>

here is the html code

i took out the spaces and still get the error message:

run-time error '424': object required

thanks

dana
 
This is non-related, but does the Span object support the alt property or should it be the title property?

Is the hyphen below a typo? This could be the culprit if it appears this way in your HTML.

<span ID-&quot;ErrorMsg&quot; align = &quot;left&quot; alt = &quot;Error Message here&quot;><font color=&quot;#ff0000&quot;>
<p>Error Message!</font><br></p></span>

SWAG, but try:

<span ID=&quot;SpanMsg&quot; align=&quot;left&quot; title=&quot;Error Message here&quot;><font color=&quot;#ff0000&quot;>
<p=&quot;ErrorMsg&quot;>Error Message!</font><br></p></span>

If this doesnt help, you may want to post the HTML or ASP. Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top