[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

Triggering an event for input tag that is readonly

Below is the attached code, i have an input tag where its value is selected from anchor tag. How do i trigger an event that validates the entered date as soon it is selected from the anchor tag(calendar)

Which event attribute should i use in such a case
<input type="text" class="txt3" name="fromDate" id="fromDate" onmouseup="validateFromDate(fromDate.value)" readonly>
								<a href="#" onClick="setYears(2000,2050);showCalender(this,'fromDate');">
								<img src="../../images/calender.png" border="0"></a>

Open in new window

0
Mavidy
Asked:
Mavidy
  • 2
1 Solution
 
quincydudeCommented:
does onchange work?
<input type="text" class="txt3" name="fromDate" id="fromDate" onchange="validateFromDate(fromDate.value)" readonly>
								<a href="#" onClick="setYears(2000,2050);showCalender(this,'fromDate');">
								<img src="../../images/calender.png" border="0"></a>

Open in new window

0
 
quincydudeCommented:
Also this
<meta http-equiv="expires" content="0">

Open in new window

0
 
Michel PlungjanIT ExpertCommented:
You need to repeat the onmouseup code
for example
onmouseup="validateFromDate(fromDate.value)" readonly>
                                                <a href="#" onClick="setYears(2000,2050);showCalender(this,'fromDate');validateFromDate(fromDate.value); return false">
                                                

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!

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