You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Mounagurusamy, Jayakumar (HAL)" <JM...@HollandAmerica.com> on 2003/06/25 18:12:13 UTC

Validate Client side(Javascript) code shows up in the page

Hello,

I got the following configuration in the struts-config.xml, 

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property property="pathnames"
value="WEB-INF/resources/validator/validator-rules.xml,
WEB-INF/resources/validator/apisValidation.xml" />
  </plug-in>

when I go to the html page the JavaScript code shows up in the page which
suppose not to be there. When look into the source code through view source,
I see the following code and remaining out side the <script> tag? I am not
sure what configuration I miss??

<script type="text/javascript" language="JavaScript">
  <!--
  var focusControl =
document.forms["apisLogonForm"].elements["bookingNumber"];

  if (focusControl.type != "hidden") {
     focusControl.focus();
  }
  // -->
</script>

thanks

Jay

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Validate Client side(Javascript) code shows up in the page

Posted by Greg Dunn <gr...@mo.nisc.cc>.
How is client side validation going to work if the JavaScript isn't there?

Regardless, this JavaScript is to set the focus on the field you specified
in the form with the focus="fieldName" attribute of the <html:form> tag.

Greg


-----Original Message-----
From: Mounagurusamy, Jayakumar (HAL)
[mailto:JMounagurusamy@HollandAmerica.com]
Sent: Wednesday, June 25, 2003 11:12 AM
To: 'Struts Users Mailing List'
Subject: Validate Client side(Javascript) code shows up in the page


Hello,

I got the following configuration in the struts-config.xml,

  <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
        <set-property property="pathnames"
value="WEB-INF/resources/validator/validator-rules.xml,
WEB-INF/resources/validator/apisValidation.xml" />
  </plug-in>

when I go to the html page the JavaScript code shows up in the page which
suppose not to be there. When look into the source code through view source,
I see the following code and remaining out side the <script> tag? I am not
sure what configuration I miss??

<script type="text/javascript" language="JavaScript">
  <!--
  var focusControl =
document.forms["apisLogonForm"].elements["bookingNumber"];

  if (focusControl.type != "hidden") {
     focusControl.focus();
  }
  // -->
</script>

thanks

Jay

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Validate Client side(Javascript) code shows up in the page

Posted by David Graham <gr...@yahoo.com>.
What version are you using?  This sounds like a bug that was fixed some
time ago.

David

--- "Mounagurusamy, Jayakumar (HAL)" <JM...@HollandAmerica.com>
wrote:
> Hello,
> 
> I got the following configuration in the struts-config.xml, 
> 
>   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
>         <set-property property="pathnames"
> value="WEB-INF/resources/validator/validator-rules.xml,
> WEB-INF/resources/validator/apisValidation.xml" />
>   </plug-in>
> 
> when I go to the html page the JavaScript code shows up in the page
> which
> suppose not to be there. When look into the source code through view
> source,
> I see the following code and remaining out side the <script> tag? I am
> not
> sure what configuration I miss??
> 
> <script type="text/javascript" language="JavaScript">
>   <!--
>   var focusControl =
> document.forms["apisLogonForm"].elements["bookingNumber"];
> 
>   if (focusControl.type != "hidden") {
>      focusControl.focus();
>   }
>   // -->
> </script>
> 
> thanks
> 
> Jay
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org