Subject: RE: From: Jerry Ventura <jventura@xxxxxxxxxx> Date: Thu, 20 Jan 2000 18:13:17 -0500 |
In your example, it may be the case of the validate() function function validate()... with lower case v, whereas onsubmit="return Validate()" with upper case V. I'm pretty sure case matters... -----Original Message----- From: Seema Ramanathan [mailto:sramanathan@xxxxxxxxxxxx] Sent: Thursday, January 20, 2000 2:38 PM To: xsl-list@xxxxxxxxxxxxxxxx Subject: Re: Problems with JavaScript. I am using Saxon 4.5 and my processor is not creating any unnecessary white spaceor splitting my script into two lines, like Craig mentioned! I tried 3 different ways: 1. Used onsubmit="return Validate()" in my form and had the following function in my XSL <SCRIPT LANGUAGE="JAVASCRIPT"> <![CDATA[ function validate(){ alert("Your submission will now be sent")} ]]></SCRIPT> This did not work! 2. Used onsubmit="return Validate()" in my form and had the following in my XSL: <script language="JavaScript" type="text/javascript" src="validate.js"></script> This again did not work, how does the "return Validate()" call know that the function is in the external "validate.js" file? This did not work either! Am I missing something here? 3. Just for testing purpose I used : onsubmit="alert('Your submission will now be sent') and this one worked! ----- Original Message ----- From: Wohlfeil, Craig <cwohlfeil@xxxxxxxxxxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxx> Sent: Friday, January 14, 2000 7:25 AM Subject: RE: > That has worked successfully for me. I guess I would start by looking at the > HTML that is produced. Make sure that there are no problems with whitespace > (like your javascript line being split into two lines in the middle or > something like that). I've had to configure my processor to strip all > unneccessary whitespace to get JavaScript (and some HTML) to work well. > > -----Original Message----- > From: Seema Ramanathan [mailto:sramanathan@xxxxxxxxxxxx] > Sent: Thursday, January 13, 2000 4:45 PM > To: xsl-list@xxxxxxxxxxxxxxxx > Subject: Re: > > > Craig > > I have been working around the same problem today. > My xsl has a form and it calls onsubmit="return validate()" > This function validate() I saved into a external file with extension js. > > Like you mentioned i tried referencing it via: > <script language="JavaScript" type="text/javascript" > src="myscript.js"></script> > > but it does not seem to work. Any suggestions? > > Seema > > ----- Original Message ----- > From: Wohlfeil, Craig <cwohlfeil@xxxxxxxxxxxxxxxxxxxx> > To: <xsl-list@xxxxxxxxxxxxxxxx> > Sent: Thursday, January 13, 2000 11:52 AM > Subject: RE: > > > > One way to get around problems with JavaScript is to put your script in an > > external .js and reference it with the script tag like such: > > <script language="JavaScript" type="text/javascript" > > src="myscript.js"></script> > > > > Craig > > > > -----Original Message----- > > From: con_Shravan K. Mishra [mailto:con_smishra@xxxxxxxxxxx] > > Sent: Thursday, January 13, 2000 12:19 PM > > To: xsl-list@xxxxxxxxxxxxxxxx > > Subject: > > > > > > > > i'm trying to use some very simple javascript validation in my stylesheet > > but it doesn't seem to work. > > can anyone please help me on this. > > > > > > <?xml version="1.0"?> > > <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> > > > > <xsl:template match="/"> > > <html> > > <title>login</title> > > > > <SCRIPT LANGUAGE="JAVASCRIPT"> > > > TA[ > > > > function setFocus(object) { > > object.select(); > > object.focus() > > } > > > > function validateData() { > > > > if(LoginForm.userID.value.length == 0) { > > alert("Enter User Name "); > > setFocus(LoginForm.login_id); > > }else > > if(LoginForm.password.value.length == 0) { > > alert("Please Enter Password "); > > setFocus(LoginForm.password); > > }else { > > LoginForm.submit(); > > } > > } > > > > ]]></SCRIPT> > > > > > > > > > > <body> > > <xsl:apply-templates/>......................................... > > ..................................... > > ............................. > > > > > > > > > > > > > > thanks > > > > sh > ravan > > > > > > > > > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE:, Wohlfeil, Craig | Thread | Re:, Seema Ramanathan |
Re: How to do numeric validations i, Marcus Carr | Date | Using Entity References in XSL Temp, Theodore Epstein |
Month |