hi!
consider doing both - javascript may be turned off by the user in the
browser.
if turned on, all required fields will return filled out correctly. if some
values
are missing, you know that javascript has been turned off and can handle 
the checks on the server side.
in that case you will normaly know the names of the required fields anyway -
but in order to make your code portable, consider the previously posted tip
to use standardized names for the required fields (by adding a prefix or
suffix
like "req_" or "_req" or the like...) so the servlet may be used for any
HTML-form. 
greets

> Thanks for the reply and tip.
> I think at this point it is more curiosity than necessit. I will probably 
> handle the required fields in JavaScript
> 
> Witold
> 
> On 5 Jun 2002 at 18:59, Jason Kilgrow wrote:
> 
> > You can access the attributes through the javascript DOM (document
> > object model). However, I don't think that your example will work
> > <input name="EMAIL" type="text" required="yes" /> The "required"
> > attribute is not recognized by the DOM and you wouldn't be able to
> > query for that attribute at all. It wouldn't even be accessible in the
> > request parameters. To do something like that, you may want to
> > consider using one of the little used attributes of the input tag. For
> > example, you may be successful using the "title" attribute or the
> > "alt" attribute. These attributes are in the HTML and XHMTL DTD and
> > the DOM recognizes them as valid attributes. In my opinion, I think
> > you would be better to handle something like this in the javascript.
> > There may be other circumstances where you can't do this but, from the
> > little you've described, it sounds to me that it could be very easily
> > taken care of in the javascript. Also, where I work, it's pretty much
> > standard to do all the form validation before the page is submitted to
> > the server. Yet another reason I would do it in the javascript if at
> > all possible.
> > 
> > "Witold Iwaniec" <[EMAIL PROTECTED]> wrote:
> > 
> > >Thanks for the reply.
> > >There are some ways to solve the problem but I am curious if there is
> > >a way to get at the attributes...
> > > 
> > >Witold
> > >
> > >On 5 Jun 2002 at 12:18, James A. N. Stauffer wrote:
> > >
> > >> You could name all required fields with a standard. �i.e. prefix
> > >> the name with "r_". 
> > >
> > >To change your membership options, refer to:
> > >http://www.sys-con.com/java/list.cfm
> > >
> > 
> > 
> > __________________________________________________________________
> > Your favorite stores, helpful shopping tools and great gift ideas.
> > Experience the convenience of buying online with Shop@Netscape!
> > http://shopnow.netscape.com/
> > 
> > Get your own FREE, personal Netscape Mail account today at
> > http://webmail.netscape.com/
> > 
> > 
> > To change your membership options, refer to:
> > http://www.sys-con.com/java/list.cfm
> 
> 
> 
> To change your membership options, refer to:
> http://www.sys-con.com/java/list.cfm
> 

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net


To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to