after submitting the form , i am doing validations in a servlet.
all values i am putting in session attribute and forwarding to formjsp. i am able to persistent text fields. but how to persistent dropdrowns. please somebody help in it.
Bear Bibeault wrote:Set the selected attribute on the appropriate <option> element.
thanks.can you give me example.
user select a date (dropdrown) in formjsp and submits. i captured the date and put it in a session of servlet. when i return from servlet to jsp. i know the date(which he selected).but how to persist the date. dependds on the condition.one date has to select .
so for which option element , select attribute i can write.
can you help me please.if possible give me example
Deepak Bala wrote:You may either use a framework that will do this for you
you can track which date was selected, set that value in the request attribute when returning to the JSP; read the request attribute and set the appropriate SELECTED field.
i am not using any framework. yes you are correct. i am capturing the date value with session attribute in jsp. but this value should be select for one of the options given under select element.
can you give me example please.
this is my formjsp after i submitted this, i captured the year in servlet and from servlet, control is transfered to formjsp page.
now in enteredyear attribute contains the year that i selected in the formjsp(firsttime). now date has to be selected automatically is entereddate year value.
where can i kept my select attribute in which option element? . please give me example
You can go back and change your post to add code tags by clicking the button on your post.