Link to home
Start Free TrialLog in
Avatar of JackOfPH
JackOfPHFlag for Philippines

asked on

Required Field Validator does not work in other browser.

I am using ASP.net 1.1, vb 2003.

Does anyone of you experience that the required field validator does not work in other browser like:
google chrome, safari, and netscape?


I have this problem and need to make it compatible with other browser...

Any ideas how to solve this problem?

your input is greatly appreciated.

Jack

ASKER CERTIFIED SOLUTION
Avatar of Rajkumar Gs
Rajkumar Gs
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JackOfPH

ASKER

@dhansmani

Have patient, but I have to ask...

Why do I need to put Page.validate?
And what does putting page.validate in the page_load in other browser?

ASP.NET 1.1 usually generates client-side script geared towards IE 4 and later using the IE DOM and not the more cross browser compatible W3C DOM, therefore with the normal settings browsers like
Mozilla will not get that client-side script at all. Server-side validation on postback should nevertheless work independent of the browser and any client-side script ASP.NET might or might not generate.

That was what I figured and as soon as I added the test for IsValid, it seems to work fine.
if (!Page.IsValid)
{
return;
}

So, if I convert this in vb...

It should be like this?

If Not Page.IsValid
{
return
}
Page.Validate(); method is invoked when a user clicks any ASP.NET server control that has the CausesValidation property set to true, which is the default.
If Not Page.IsValid Then
 Return
End If

Do I need to test if the Page.IsValid or not?



If you want to validate, u need to use Page.IsValid
I have added a .js File ....

If you are using a scriptmanager , add the JS file  ref as given in code

otherwise add the JS file to the HEAD section

Hope this helps...
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
  <Scripts>
    <asp:ScriptReference Path="~/SafariFix.js" />
   </Scripts>
</asp:ScriptManager>

Open in new window

SafariFix.js
@masterpass,

Can you explain to me, what the script does?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Currently testing which will solve the issue...

Please, have patience...

Thanks,

Joseph