MsgBox For I.E and Mozilla Browsers

scalf

Freshman
Joined
Jun 15, 2004
Messages
25
Location
FRANCE
Hello,

I'm looking for a message Box which I could use in both Internet Explorer and Mozilla to help me display error messages of Validator controls in both types of browser.

In fact the ShowMessageBox property of the ValidationSummary control works fine with I.E but not with Mozilla Browsers...

If someone has an idea.

NB : If necessary, VB samples are welcome.
 
scalf said:
Hello,

I'm looking for a message Box which I could use in both Internet Explorer and Mozilla to help me display error messages of Validator controls in both types of browser.

In fact the ShowMessageBox property of the ValidationSummary control works fine with I.E but not with Mozilla Browsers...

If someone has an idea.

NB : If necessary, VB samples are welcome.

You might be better off disabling the ShowMessageBox property, writing a javascript function that mirrors your server validation code, and then adding it to the button onClick using:
button1.Attributes.Add("onClick", "return yourjavascriptfunction();")

Then return false or true from the javascript function to either cancel the button click, or submit the form as appropriate. If you add a javascript alert into your validation code if validation fails, this will run in all browsers that support javascript.

Hope this helps,

Adam
 
Thank you very much,

I thought of that at the beginning but what I find boring with Javascript is the many syntaxes for the different objects of the form...For exemple, I'm trying for the moment to read the value of two radio buttons to see if they are checked or not. I succeeded for the first radio button, but with the same syntax, on the second radio button, it doesn't work...

this is the syntax I use :

if(document.forms[0].myRadioBtn1[0].checked ==false)

{

some code..

}

If it works for one, it should work for the other button, but unfortunatly...it doesn't work :(

booler said:
You might be better off disabling the ShowMessageBox property, writing a javascript function that mirrors your server validation code, and then adding it to the button onClick using:
button1.Attributes.Add("onClick", "return yourjavascriptfunction();")

Then return false or true from the javascript function to either cancel the button click, or submit the form as appropriate. If you add a javascript alert into your validation code if validation fails, this will run in all browsers that support javascript.

Hope this helps,

Adam
 
Back
Top