This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes how to fetch values of elements on same page Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "how to fetch values of elements on same page" Watch "how to fetch values of elements on same page" New topic
Author

how to fetch values of elements on same page

Nishant Vashisth
Greenhorn

Joined: Jun 27, 2011
Posts: 23
guys i am trying to make a date system
in which when user selects year from a drop down list then according to the year selected the
month drop down list is activated
then if the month selected is a 31 days month then the disabled days drop down is activated with 31 days
or for February with 28 days or 29 days..

so how to get the value of the selection of the year and month on the same jsp page
so can you tell me
Arun Chidam
Ranch Hand

Joined: May 08, 2006
Posts: 79
You can do it either through client side(java script) where you control months and days from the script or from server side where you can redirect to same JSP when user selects a particular month and populate the days as per the month selected, also look into AJAX ideal for loading only partial data.


SCJP 1.4, SCWCD 1.4
Nishant Vashisth
Greenhorn

Joined: Jun 27, 2011
Posts: 23
yes but my course does not has javascript so can you tell me just HTML functions or normal java scriplets !! ???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

There are no such things as "HTML functions".

The proper way to do this is with JavaScript on the page, Without that you are forced to re-write the entire page making the changes that are needed.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Nishant Vashisth
Greenhorn

Joined: Jun 27, 2011
Posts: 23
Bear Bibeault wrote:There are no such things as "HTML functions".

The proper way to do this is with JavaScript on the page, Without that you are forced to re-write the entire page making the changes that are needed.


ya my bad. I am not aware with the terms much. :P

still isn't there another way using java but not the javascripts.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

I repeat:
Bear Bibeault wrote:you are forced to re-write the entire page making the changes that are needed.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how to fetch values of elements on same page
 
Similar Threads
how to handle the mouse scroll in javascript?
Ajax: how to achieve
How to automatically change the page contents with change in drop down list option selection
retrive data from db2 as month and year wise
Drop down list value