/    Sign up×
Community /Pin to ProfileBookmark

textbox onchange event

Hi all

I am new to javascript and this probably might be a newbie question. I have a a date text box and next to it i have a calender icon that is a date picker.When user picks a date, that date gets displayed in the textbox.

What i want to achieve is, As soon as the user picks a date with the date picker and the date is seen in the textbox beside, I want to call a javascript method. I am using something like

[code=html]
<input type = “text” onchange=”dateChanged(this.form)” blah blah………>
[/code]

[CODE]
function dateChanged(form){
var dateVal=form.collEventDate.value;
self.location=’newSpecimen.php?date=’+dateVal;
}
[/CODE]

But the function is not called. What is the problem? thanks

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonNov 01.2007 — Why not call the function at the end of whatever function puts the date into the text box?
Copy linkTweet thisAlerts:
@muthucheliyanAug 06.2008 — have you got any solution for this problem ....i have to call a function on "onchange" of the date..i tried to call that function ...from the function which load the date to the inbox(functions given for the calender)...its not working..even a alert is not working form the predefined functions for that calender....help plz

Muthucheliyan V
Copy linkTweet thisAlerts:
@KorAug 06.2008 — [B]onchange[/B] will trigger the function when [I]both[/I] conditions are fulfilled: 1: the element loses its focus and 2: the element's value has changed. In your case (a third function fills data into a textbox from a date picker application) there is no focus/blur, so that you should read attentively again the David Harrison's solution:

call the function at the end of whatever function puts the date into the text box
[/quote]
Copy linkTweet thisAlerts:
@muthucheliyanAug 07.2008 — hi kor thanks for your reply,problem is even an alert is not working on the functions given for that calender .i mean the function which load the date into that text box..hope you got it..in this case is der any work around to call my function when date changed using the calender...?
Copy linkTweet thisAlerts:
@KorAug 07.2008 — it is hard to say without seeing all the codes... Can you post a link to a test page?
Copy linkTweet thisAlerts:
@muthucheliyanAug 07.2008 — This is the text box where date will be filled when they select using the calender....

[COLOR="DeepSkyBlue"]<input type="text" name="rewdgdate" id="rewdgdate" size="10" onchange="onRWDateChange('rw');" > [/COLOR]

This the call for the calender.....

[COLOR="Red"]<a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(document.ConeRewindingStudy.rewdgdate); return false;" HIDEFOCUS>

<img name="popcal" align="absmiddle" src="images/calendar.gif" width="25" height="16" border="0" alt=""></a>

<iframe width=20 height=178 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="css/WeekPicker/ipopeng.htm"

scrolling="no" frameborder="0" style="visibility: visible; z-index: 999; position: absolute; top: -500px; left: -500px;" ></iframe>[/COLOR]


"ConeRewindingStudy" is the form name,rewdgdate is the name of text box where the date value need to be filled...

attachement details:

ipopeng is htm file ...other files are

js files. i hope calender1.js and ipopeng.htm play the major role for this calender action.also i attached the other files as well..

thanks..

[upl-file uuid=5827300d-8435-4a2b-b31a-c50018b90696 size=6kB]calendar1.txt[/upl-file]

[upl-file uuid=07a9eeb4-5942-4be3-becb-a1ff48b6666b size=7kB]plugins.txt[/upl-file]

[upl-file uuid=294a762d-6da6-446f-bae8-bd63b8d8fe97 size=4kB]agenda.txt[/upl-file]

[upl-file uuid=7520384d-20d5-4ae4-b660-d1932616149d size=9kB]normal.txt[/upl-file]

[upl-file uuid=d0bf4104-c4d9-4e5e-9f0a-00b40c2fe75e size=23kB]ipopeng.txt[/upl-file]
×

Success!

Help @prachu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...