Forum Moderators: open

Message Too Old, No Replies

newbie question: javascript not showing up on html page on IIS server

         

patricia_e

5:03 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



Hi,
Please excuse what is probably the most basic question to some...
I have worked on a unix box forever and got myself into a "favor" for someone which requires that I update/create some web pages on an IIS server.

I have a registration form and want to validate certain fields. I only care if the user has entered some text or not. Nothing too complicated. I have included this javascript in the head of the document:

<script language="JavaScript">

<!-- hide JS code

function isBlank(testStr)

{
if (testStr.length == 0) // nothing entered?
return true
for (var i = 0; i <= testStr.length-1; i++) // all spaces?
if (testStr.charAt(i)!= " ")
return false
return true
}

function checkForm(form)

{
if (isBlank(form.name.value))
{
alert("Please enter your name.")
form.name.focus()
return false
}

if (isBlank(form.phone.value))
{
alert("Please your phone number.")
form.phone.focus()
return false
}

if (isBlank(form.email.value))
{
alert("Please enter your email address.")
form.email.focus()
return false
}

return true
}

// end JS hide -->

</script>

When I go to view the page's source code through the browser, this javascript is missing. The page does not do any validation. What big "duh" mistake am I making?

Sincerely,
Patricia

Bernard Marx

5:32 pm on Aug 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the script is missing from the source code, then the problem has nothing to do with the script itself. Is this online?(sticky the URL if it is).

patricia_e

9:00 pm on Aug 18, 2004 (gmt 0)

10+ Year Member



Bernard,
After I got done posting this question on various boards, I went back and it appeared. I'm sorry to have bothered you. Possibly a cache problem although I cleared it about 500 times (or so I thought).

Thank you so much for replying!

(I can't find the emoticon with a dunce cap, but that would be appropriate here...)

Bernard Marx

9:24 pm on Aug 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Best make one up then:
<:(

Good to know you got it sorted, anyway.