Forum Moderators: open

Message Too Old, No Replies

Service Pack 2 Problem

How can I validate a form?

         

jonrichd

11:17 pm on Aug 15, 2004 (gmt 0)

10+ Year Member



I just installed SP2, and am now experiencing some of the security updates Microsoft put in.

On several of my sites, I have registration forms. Each form contains Javascript that makes sure that the user has filled in required fields.

The FORM tag uses 'onSubmit="return validate_form()"' to call JS code. The JS code has, for each required field, something like this:

if (document.form.city.value == "") {
alert("Please enter your city.");
document.form.city.focus();
return false;
}

If the user makes it through all the fields, the JS returns True, and off we go to process the form.

Problem is that whenever the page containing the form displays, IE puts up an information bar saying that it is restricting the file from showing active content.

IE won't give the page a clean bill of health unless I remove the OnSubmit and the JS code, or unless I remove the form itself, leaving the JS code.

Has anyone else seen this, and does anyone have any ideas for a workaround, short of doing the validation on the server side?

On a somewhat related issue, I also visited a major bank's site today that uses JavaScript to do a document.write to create a frameset and frames. JavaScript gave a 'permission denied' error at the first document.write. I couldn't figure out how to get the page to run; finally gave up and installed Firefox.

vkaryl

11:45 pm on Aug 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't know. I'm not sure MS knows. One of the REALLY bright people here probably can help.

What I DO know is that beginning as soon as I retire, I'm going to rid every site I run of js. It's just not worth the agony.

kaled

8:41 am on Aug 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't installed SP2 yet, so I have this problem to look forward to. However, I think I have a workaround for you.

Instead on using OnSubmit, create a simple button and use it's OnClick event. If the form validates, call the form.submit() method.

Assuming this works, there will be one drawback - the button will have to be clicked, pressing ENTER will not work.

If this works, please let us all know.

Kaled.

flashfan

1:52 pm on Aug 16, 2004 (gmt 0)

10+ Year Member



On a somewhat related issue, I also visited a major bank's site today that uses JavaScript to do a document.write to create a frameset and frames. JavaScript gave a 'permission denied' error at the first document.write.

I couldn't repeat the problem you mentioned above. (XP Pro+SP2)

canonis

2:26 pm on Sep 2, 2004 (gmt 0)



I am also experiencing various Permission Denied errors on numerous sites around the Internet now that I have upgraded to Windows XP Service Pack 2 (SP2). I have been able to replicate this on my work computer and on my home computer.

When I view the source the error points to a document.write. Now the weird thing is, is that if I receive the javascript error and I refresh, I don't get the error.

I am 100% this is related to Win XPSP2.

Lance

11:34 am on Sep 3, 2004 (gmt 0)

10+ Year Member



I've seen this in simple html files that contain js that I've had on my desktop. And I mean real simple files that are specifically to test just one thing. But if I move the same file to a web server, it works fine.

A search of MSKB mentiond something about it being a cross-domain security issue. I'm not completely sure why that applies to a file on my desktop, but it seems like it affects pages that use scripts who's source is located in a different domain.

cybersonic

7:35 pm on Sep 22, 2004 (gmt 0)



on the issue about a major bank site not working anymore after installing SP2:
I assume you meant the Suntrust internet banking site?
If that's the case, do you by any chance use the Google toolbar? If so, try deactivating the 'AutoFill' function - that should fix the issue for the Suntrust site.

TomR

4:02 pm on Nov 7, 2004 (gmt 0)



I had this problem too and Cybersonic solved it. His post was:
on the issue about a major bank site not working anymore after installing SP2:
I assume you meant the suntrust internet banking site?
If that's the case, do you by any chance use the Google toolbar? If so, try deactivating the 'AutoFill' function - that should fix the issue for the suntrust site.

I did this and it worked and I was ecstatic, but I had another computer that still has the autofill enabled and it was working. A little more research determined that the newest version of the Google toolbar fixes the problem without disabling autofill.

I hope this can help others with this elusive and frustrating problem. Thanks a million Cybersonic.

[edited by: tedster at 6:55 pm (utc) on Nov. 7, 2004]
[edit reason] splice with original thread [/edit]