Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Problem on switch between radioes

My page has two radio boxes and two input text boxes. I wrote a javascript method setTimeStamp() which checks the second radio when the user tries to input value in the text box. My problem is that when the user select the date from the popup Calendor, it will not switch to the second radio. Can someone help me to solve this problem? Thanks!

function setTimeStamp(){
     if(!document.searchForm.timeStamp[1].checked)
          document.searchForm.timeStamp[1].checked=true;
}


<INPUT type="radio" name="timeStamp" value="false" checked>
<B>All</B><BR>
<INPUT type="radio" name="timeStamp" value="true">
<B>From: </B>
<INPUT type="TEXT" name="startDate" maxlength=10 size=10 onfocus="setTimeStamp()">
<a href="javascript:popupCalendar();">
<IMG src="images/icon_cal.gif" border="0" name="cal1" alt="Click here to pick up the From timestamp." width="26" height="15"></A>
<B>To: </B>
<INPUT type="TEXT" name="endDate" maxlength=10 size=10 onfocus="setTimeStamp()">
<a href="javascript:popupCalendar();">
<IMG src="images/icon_cal.gif" border="0" name="cal2" alt="Click here to pick up the From timestamp." width="26" height="15"></A>
0
Amy01
Asked:
Amy01
1 Solution
 
cubrovicCommented:
You can just change

<a href="javascript:popupCalendar();">

to

<a href="javascript:popupCalendar();setTimeStamp()">

and i guess this is what you want to do

0
 
Amy01Author Commented:
Thanks! It works. Cool!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now