Re: Form with 2 textfields
2005/07/08 16:34
Viewed 14805 times
Replies: 1/2

Excellent product!!!!

I have the exact same situation as described by Danne. I have the date on one form field and the time in another. How can I hook jscalendar to populate both form fields upon selection?

Thanks,

AJ

Re[2]: Form with 2 textfields
2006/03/10 18:26
Viewed 14302 times
Replies: 1/1

I think we all agree this is a fantastic script! However i can't also separate the results into 2 diferent fields, for instance a filed for month, other for day

Can anyone explain me how can we do that

last
Re[3]: Form with 2 textfields
2006/05/12 22:43
Viewed 15270 times
Replies: 0/0

I just started playing with this script today, and this was the first thing I needed to tackle. I needed the month, day and year in separate boxes, so after some poking around, I was able to modify the Linked fields example to get this to work. Try this:

<input type="text" name="month" id="f_date_a" size="2"/>/
<input type="text" name="day" id="f_date_b" size="2"/>/
<input type="text" name="year" id="f_date_c" size="4"/>
<input type="reset" id="f_trigger_b" value="...">

<script type="text/javascript">
function catcalc(cal) {
var date = cal.date;

var field = document.getElementById("f_date_b");
field.value = date.print("%d");

field = document.getElementById("f_date_c");
field.value = date.print("%Y");
}
Calendar.setup({
inputField : "f_date_a",
ifFormat : "%m",
button : "f_trigger_b",
onUpdate : catcalc
});
Calendar.setup({
inputField : "f_date_b",
ifFormat : "%d"
});
Calendar.setup({
inputField : "f_date_c",
ifFormat : "%Y"
});
</script>

last
Google