You could name all required fields with a standard. i.e. prefix the name with "r_". --- Witold Iwaniec <[EMAIL PROTECTED]> wrote: > Hello > > Is there a way, in a servlet application, to get values on "non-default" > attributes of elements on a page? > > For example, if on my web page I have: > > <input name="EMAIL" type="text"> > > in the HttpServletRequest I will have parameter with teh name "EMAIL" > and value whatever the textbox contains. > I wonder if there is a way to read other attributes, in this case value > of > "type". > > Actually here is my problem. > On the pages where user has to enter values, some of the fields are > required. If the value is blank, I would redisplay the page, with values > that have already been entered and display error message. > I know that there are some options: > - it can be done thorugh a JavaScript right on the client > - in my servlet code I can now which are required elements and deal > with it > - store the elements in a table > - others > > But I would like to write a generic procedure that checks required > elements. I could, for example, add attribute to the HTML elements: > > <input name="EMAIL" type="text" required="yes"> > > and in the code iterate through the request parameters, dynamically > find out which are required, and deal with it. > > Thanks > > Witold > > > > > > To change your membership options, refer to: > http://www.sys-con.com/java/list.cfm
===== = o o o o o o o . . . __________________________ _____=======_||___ o _____ | James A. N. Stauffer | | Stauffer_James | .][__n_n_|DD[ ====____ | Spam food: [EMAIL PROTECTED] | | @yahoo.com | >(________|__|_[________]_|________________________|_|________________| _/oo OOOOO oo` ooo ooo 'o¬o¬o o¬o¬o` 'o¬o o¬o` __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com To change your membership options, refer to: http://www.sys-con.com/java/list.cfm