You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bob Byron <bb...@MailAndNews.com> on 2000/07/22 21:05:38 UTC

RE: setProperty and arrays - Workaround!

>===== Original Message From "Bart N. Locanthi" <ba...@sabl.com> =====
>this *almost* works. i'm pleasantly surprised that it tries.
>
>however, if the first text input is blank, the setGrade() doesn't get
>called.

Okay, to insure that you receive the setGrade() call even if the first input 
element is blank, just add a hidden input field before your list.  Make sure 
the hidden input contains a value, then the setGrade method is absolutely.  
You simply ignore the 0 element.

<form action="test.jsp" method="post">
<input type="HIDDEN" name="grade" value="IgnoreMe" size="10"><Br>
<input type="text" name="grade" value="" size="10"><Br>
<input type="text" name="grade" value="" size="10"><Br>
<input type="text" name="grade" value="" size="10"><Br>
<input type="text" name="grade" value="" size="10"><Br>
<input type="submit" name="submit" value="Submit">
</form>

------------------------------------------------------------
Bob Byron
RAD Systems, Inc.
(972)516-4256


RE: setProperty and arrays - Workaround!

Posted by "Rob S." <rs...@home.com>.
> <form action="test.jsp" method="post">
> <input type="HIDDEN" name="grade" value="IgnoreMe" size="10"><Br>
> <input type="text" name="grade" value="" size="10"><Br>
> <input type="text" name="grade" value="" size="10"><Br>
> <input type="text" name="grade" value="" size="10"><Br>
> <input type="text" name="grade" value="" size="10"><Br>
> <input type="submit" name="submit" value="Submit">
> </form>

Kind of open to user-twiddling tho'.  Anything that could adversely affect
your app shouldn't be visible.  Lots of people make this oversight when
dealing with HIDDEN fields, like storing IDs there to be carried from page
to page.  It's not uncommon to see things like:

<input type="HIDDEN" name="userID" value="345566">

Which can be a bad scene.

- r