problem with inserting date picker..

hi iam having ajava script function called emptySelect()
which is used for dynamic change of values in two select boxes..like if we select a country then the states of that conutry in shown..
function emptyselect1( myObj )
{
if((myObj.options[myObj.selectedIndex].value == "F_ARCHIVEDATE" ) || (myObj.options[myObj.selectedIndex].value == "F_DELETEDATE" ) || (myObj.options[myObj.selectedIndex].value == "F_ENTRYDATE" ) || (myObj.options[myObj.selectedIndex].value == "date1" ))
{

if these fields are selected:

then
document.search.value1.. is an input text box..

if user selects any of above values and goes to this text field and if he clicks on that field i want to show date picker..
onClick="javascript:void( window.open( 'calendar.html?endDate', '', 'width=200,height=200,top=120,left=120' ))"

this event i want to erpform on text field..

this thing should hapeen only if user selects any of above date fields..
for others it should keep emty..

regards,
sampath
[1124 byte] By [sampathreddyv2000] at [2007-11-19 1:38:57]
# 1 Re: problem with inserting date picker..
how far have u managed to do it? where exactly are u stuck? what part do u want help? post some working code from ur side...only then can some one help u.
i hope ur not expecting some one to code the entire thing for u?? ;)
PallaviDalvi at 2007-11-8 0:20:04 >
# 2 Re: problem with inserting date picker..
as i told u iam stuck at how to set that function to that filed called value1..if user selects any of the date field..then i want to set onClick function for that value1 field with above syntax..
iam not getting any idea.how can set a java script function to text field dynamically..

regards,
sam
sampathreddyv2000 at 2007-11-8 0:21:04 >
# 3 Re: problem with inserting date picker..
well i dont think any thing shud be done dynamically in this particular case. according to my understanding...
1. User selects the country.
2. the states are programatically (we can safely say automatically) populated in the second drop down.
3. user selects a state.
4. Now user shud be allowed to make a date selection.
if this is what shud be happening then i see a simple checking of conditions. the onclick is attached to the textbox and in that function i check if the above cases have been fulfilled. if yes then display the date picker else dont!
u see, its quite simple. now u just have to put the above in code and bingo! :)
PallaviDalvi at 2007-11-8 0:22:02 >