/    Sign up×
Community /Pin to ProfileBookmark

Simple Question for Javascript Experts

I am attempting to utilize a javascript popup calendar to populate a text field with the user selected date. There are multiple text fields in the form, generated by php, for multiple rows of input. The names of the date fields are formatted date[0], date[1], etc.. to allow all of the rows of input to be processed by the php. However when the names are in this format the javascript does not work. If the name is static such as date, it works. The problem lies in having the name in the format date[x]. How do I escape/fix this string so each date will have the ability to be populated by a popup calendar?

The following is the link: <A HREF=”#” onClick=”cal.select(document.forms[‘pop’].date[x],’anchor<? echo $count; ?>’,’MM/dd/yyyy’); return false;” NAME=”anchor<? echo $count; ?>” ID=”anchor<? echo $count; ?>”>select</A>

where date[x] is date[0], date[1], etc each time link is generated. Thank you!

Ben

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FrankTheTankJul 08.2008 — I think we need to see the JavaScript code that drives cal.select. It probably needs to be updated to put the calendar value in the right text field.

Frank
Copy linkTweet thisAlerts:
@benjaminrkauthorJul 08.2008 — Thank you for your response, I have included the entire .js file.

[upl-file uuid=001560bd-5a2f-4564-a880-ab99502de84f size=57kB]jscript.txt[/upl-file]
×

Success!

Help @benjaminrk 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 4.30,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...