/    Sign up×
Community /Pin to ProfileBookmark

grabbing hidden value related to checkbox value

Im developing an online booking system and having a problem with my final booking form. basically what happens is that the user selects the dates they want by selecting the checkbox that corresponds with the date above it. the checkboxes have a value of the price of the room for that night.

Im using javascript to total the value for the selected dates but i also need a script that will select the first and last hidden date field that corresponds with the selected checkboxes so that there is an arrival date and a departure date. Im pretty new to javascript and some help would really be appreciated. This is just a really simplified version but everything is there that is needed.

Cheers
Shaun

heres a snapshot of the page to make it clear what my problem is.
[URL=http://imageshack.us][IMG]http://img95.imageshack.us/img95/3862/bookzm7.jpg[/IMG][/URL]

[code=php]
<form name=”form2″>
for($i=0;$i<28;$i++)
{
//Array of dates fot the next 28 days
<input type=”hidden”
name=”date<?php print $i; ?>”
id=”date<?php print $i; ?>”
value=”<?php print $dt; ?>” />
}

for($i=0;$i<28;$i++)
{
//Array of hotel room prices for the next 28 days
<input type=”checkbox”
id=”day<?php print $dayno;?>”
name=”day<?php print $dayno;?>”
value=”<?php print substr($price->$_GET[‘days’],0,3); ?>”
onclick=”changeCheckbox(0);” />
}
</form>

<form name=”theform”>
<table>
<tr>
<td>
<div>Arrival Date
</div>
</td>
<td>
<input type=”text” name=”arrival” value”” readonly=””>
<input type=”hidden” name=”arrival_date” value=””>
</td>
<td>
<div>Departure Date
</div>
</td>
<td>
<input type=”text” name=”departure” value”” readonly=””>
<input type=”hidden” name=”departure_date” value=””>
</td>
</tr>
</table>
</form>
[/code]

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@vandaddyauthorNov 07.2006 — any help?
Copy linkTweet thisAlerts:
@vandaddyauthorNov 09.2006 — bump.. is this a simple script or not?
Copy linkTweet thisAlerts:
@vandaddyauthorNov 12.2006 — is there anyone that can help?
×

Success!

Help @vandaddy 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.28,
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,
)...