PDA

View Full Version : Jason's date input calendar



jmlg
05-15-2006, 05:02 PM
Hi,
can you help me to put this script to "talk" with a field in database?

this script send a message (alert) with the select date. I want not an alert box but a "form name" for save in my sql server (with other fileds in the interface i created).

thank you,
Jorge Gomes

jscheuer1
05-15-2006, 05:43 PM
Then you would need to give the form and fields names if they don't already have them and make a submit button for the form. The form's action should be set to, I believe, post. This should all be done as you would for any other form that you wanted to do this.

jmlg
05-16-2006, 08:09 AM
good morning,
sorry, but I think i didn't explain well my intended.

this script allows to choose a date. When clicking in the button appears an alert with that date.
I don't want to click in the button!!!! I just want to have other fields to fill and in the end of everything an only button to record.

(ex: name:
adress:
date: (this script)
........

SAVE (button for click)

When recording (press SAVE button) I want that all the fields that I filled are inserted in my SQL.

Thus, i need to place the date that the script gives me in a text box instead of alert.
(in my ActionSave.asp i have request.form ("date"), request.form("name"), request.form("adress"),....).

Thank you!
Jorge Gomes

jscheuer1
05-16-2006, 05:04 PM
When recording (press SAVE button) I want that all the fields that I filled are inserted in my SQL.

Thus, i need to place the date that the script gives me in a text box instead of alert.

Well, how do you normally insert to MYSQL? The date items' values are already in text inputs and selects, as well as concatenated in a hidden input.



Originally from the Demo Page:
The script then creates a corresponding hidden field containing the actual chosen date for easy passing along with the rest of your form.

The alert is just for demo purposes anyway. You can use whatever kind of button (including submit) that you want. For example (from the demo):


<form>

<script>DateInput('orderdate', true, 'DD-MON-YYYY')</script>

<input type="button" onClick="alert(this.form.orderdate.value)" value="Show date value passed">

</form>

Used with the parameter 'orderdate' for the name of the hidden input means that:

this.form.orderdate.value

will be the date value and that its name will be 'orderdate'. What you do with it is up to you.