[Javascript] looking for JS advice on toggling

James Macdiarmid James.Macdiarmid at cgifederal.com
Mon Mar 5 12:14:46 CST 2007


I'm hoping someone can suggest a good way to accomplish a task.
 
So far I have a mechanism to toggle between 2 divs which contain form
controls.
The first div contains a selectionbox list and the second div contains a
date range selection with calendar similar to the following:
    From:  textbox  calendar image   To:  textbox calendar image
 
I have page that is constructed like so :
 
(pseudo-pseudocode to follow)  
 
Radio1  Textbox
Radio2  Selectionbox
Div1
Div2
 
Back Button | Submit Button

--------------- 
(Logic)
--------------- 
On page load, display controls contained in Div1
 
If Radio1 is checked,  test textbox 1 for proper input.
If Radio2 is checked,  test selectionbox ( defaults to first item in the
list)
    if selection 1 is selected, display first div container and hide
second div container.
						
    if selection 2 is selected, display second div container and hide
first div container.
 
The problem I'm having so far is when I input values for the start and
end date ranges using the calendar, then click the submit button, the
page is revalidated and doesn't know the values for the controls in the
divs have been updated.

Hopefully all this makes sense. Please let me know if you have any
questions.

Thanks in advance,
Jim 
 



More information about the Javascript mailing list