Our programs use JSP pages with direct access to the database to grab information from tables to fill listboxes. Whenever we have add and update pages for the same object (like add client, update client - though we aren't object based) our supervisor wants us to have add and update pages that call and add_update page.
i.e. addclient.jsp calls add_update.jsp to display the form (passing empty strings and 0 values to add_update.jsp to fill the form)
i.e. updateclient.jsp calls add_update.jsp to display the form (updateclient.jsp grabs values from Object passed from class file and sets variables to values grabbed from the database and passes these to add_update.jsp to fill the form)
This is the only project that uses javabeans in our workplace so.
<jsp:include page="../listboxes/displayvisitmonth.jsp" flush="true"></jsp:include>
displayvisitmonth.jsp calls visitbean and if its empty (meaning I'm adding a visit rather than updating one [which would have been uploaded to the visitbean]) then it grabs the current month and puts it in my variable intMonth.
My problems are setting the days range. I have a select statement that tests the values and for Month values 1, 3, 5, 7, 8, 10 and 12 it creates a listbox that displays the range 1-31. If intMonth equals 4, 6, 9 or 11 then the range of the listbox is 1-30. I have a special case to test February to account for leap years.
My problem is when I update. If the user changes the month I need to update the day listbox. I know this is an onChange event; when the user changes the month value then the day should update.
I want to grab the selectedIndex of my month listbox and use it for the day listbox but my attempts have failed. Can I pass it as a <jsp
aram> when I call displayvisitday.jsp or can I grab it in displayvisitmonth.jsp. I've tried both but my code is wrong and I get errors. request.getParameter didn't work like it does when I go to a next page. I am having trouble figuring out how to put the selectedIndex in the value of the <jsp
Any ideas? I have a tempvisitbean I use but I've had no luck setting this on the page with a click event.