From: Alexey Smirnov on
On Mar 15, 2:47 pm, Luigi <Lu...(a)discussions.microsoft.com> wrote:
> "Patrice" wrote:
> > The statement ends after ...
> > document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data _dateRegularExpressionValidatorID");
>
> > Then the next statement is :
> > "WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";
>
> Yes, the complete script is:
>
> <script type="text/javascript">
> //<![CDATA[
> var
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionVal idatorID
> = document.all ?
> document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegula rExpressionValidatorID"]
> :
> document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data _dateRegularExpressionValidatorID");
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionVal idatorID.controltovalidate
> = "WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionVal idatorID.display = "Dynamic";
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionVal idatorID.evaluationfunction = "RegularExpressionValidatorEvaluateIsValid";
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionVal idatorID.validationexpression
> = "^\\s*(\\d{1,2})([-./])(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$";
> var
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidat orID
> = document.all ?
> document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequir edFieldValidatorID"]
> :
> document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Data _dateRequiredFieldValidatorID");
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidat orID.controltovalidate
> = "WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateTextBoxID";
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidat orID.errormessage = "Campo [Data] obbligatorio";
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidat orID.display = "None";
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidat orID.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
> WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRequiredFieldValidat orID.initialvalue = "";
> var WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1 =
> document.all ?
> document.all["WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSumma ry1"]
> :
> document.getElementById("WebCustomControl11_ucRicostruzioneMisure.ascx_Vali dationSummary1");
> WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1.showmessag ebox = "True";
> WebCustomControl11_ucRicostruzioneMisure.ascx_ValidationSummary1.showsummar y
> = "False";
> //]]>
> </script>

What is this?

WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpressionValidatorID

You are trying to create a variable with such long id and a dot in the
name? If it's a name of existed control on the page, then what does
"var" in front of the line?
From: Mark Rae [MVP] on
"Luigi" <Luigi(a)discussions.microsoft.com> wrote in message
news:CEB98710-6DD6-4EE2-A3C7-77D7A72737D9(a)microsoft.com...

>> http://javascript.about.com/od/hintsandtips/a/worst_4.htm
>>
>> I appreciate that you're trying to evaluate whether document.all is
>> supported or not by the browser, but there's really no need to do this
>> anymore, as all modern browsers fully support
>> document.getElementById(....)
>
> In the Production environment, there is IE 6.

Surely not! IE6 is now *completely* unsupported by Microsoft, as well as
being generally acknowledged as the worst version of any browser ever
released by any company, not just Microsoft...


> In my machine I have the version 8.0.
> Maybe is here the problem?

The problem is that you are using document.all - use document.getElementById
instead

Also see the advice from Patrice...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net