You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kunal Parikh <ku...@carsales.com.au> on 2004/09/01 06:59:35 UTC

Dots in form names creates problems with Javascript Validator function names

Hi!

I have some forms with dots in their names.

The problem is that the JS validation code being generated is not quite  
right

Is there a resolution/work-around to this issue ?

e.g.

FormName: employer.search
JS generated:

=============

     function employer.search_required () {
	...
	...
     }

     function employer.search_email () {
	...
	...
     }

=============


TIA,

Kunal


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


Re: Dots in form names creates problems with Javascript Validator function names

Posted by Richard Yee <ry...@cruzio.com>.
I believe that a period is not allowed in an identifier. You should pick 
another name for your form.

-Richard


At 09:59 PM 8/31/2004, you wrote:
>Hi!
>
>I have some forms with dots in their names.
>
>The problem is that the JS validation code being generated is not quite
>right
>
>Is there a resolution/work-around to this issue ?
>
>e.g.
>
>FormName: employer.search
>JS generated:
>
>=============
>
>     function employer.search_required () {
>         ...
>         ...
>     }
>
>     function employer.search_email () {
>         ...
>         ...
>     }
>
>=============
>
>
>TIA,
>
>Kunal
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org



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


RE: Dots in form names creates problems with Javascript Validator function names

Posted by Amit Kumar Sharma <am...@sysarris.soft.net>.
Hi,

Instead of using for names in that case use.


This should not give any problem := Documet.forms[0].elements[0]

When formname and somename has dots in between.
Accessing elements in this fashion will give problem :=
Documet.formname.getElementsById("somename")

I mean to say access the elements and forms as objects not as names.Do
some minor changes to the validator java scripts formed.

Regards
Amit


-----Original Message-----
From: Kunal Parikh [mailto:kunalp@carsales.com.au] 
Sent: Wednesday, September 01, 2004 10:30 AM
To: user@struts.apache.org
Subject: Dots in form names creates problems with Javascript Validator
function names

Hi!

I have some forms with dots in their names.

The problem is that the JS validation code being generated is not quite

right

Is there a resolution/work-around to this issue ?

e.g.

FormName: employer.search
JS generated:

=============

     function employer.search_required () {
	...
	...
     }

     function employer.search_email () {
	...
	...
     }

=============


TIA,

Kunal


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


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