Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jQuery datepicker result to PHP variable 1

Status
Not open for further replies.

maharg

Technical User
Mar 21, 2002
184
Hi

I'd like to use the really neat jQuery DataRange picker described at but am struggling to understand how to transfer the chosen two dates into 2 variables in PHP, so that I can get them into a MySQL query.

I'm not familiar with jQuery at all, so would really appreciate a pointer on this one.

All the best,

Graham
 
You'd probably want to copy the datepicker value to an input element such as a textbox to then submit to your PHP script.

For instance:

Code:
onChange[COLOR=#990000]:[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]([/color]dates[COLOR=#990000],[/color]el[COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab]  [i][COLOR=#9A1900]// update the range display[/color][/i]
[tab]  $[COLOR=#990000]([/color][COLOR=#FF0000]'#date-range-field span'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]text[/color][/b][COLOR=#990000]([/color]dates[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getDate[/color][/b][COLOR=#990000]()+[/color][COLOR=#FF0000]' '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getMonthName[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]true[/color][/b][COLOR=#990000])+[/color][COLOR=#FF0000]', '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getFullYear[/color][/b][COLOR=#990000]()+[/color][COLOR=#FF0000]' - '[/color][COLOR=#990000]+[/color]
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab]dates[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getDate[/color][/b][COLOR=#990000]()+[/color][COLOR=#FF0000]' '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getMonthName[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]true[/color][/b][COLOR=#990000])+[/color][COLOR=#FF0000]', '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getFullYear[/color][/b][COLOR=#990000]());[/color]
[tab]  $[COLOR=#990000]([/color][COLOR=#FF0000]'#id_of_textbox input'[/color][COLOR=#990000]).[/color][b][COLOR=#000000]val[/color][/b][COLOR=#990000]([/color]dates[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getDate[/color][/b][COLOR=#990000]()+[/color][COLOR=#FF0000]' '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getMonthName[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]true[/color][/b][COLOR=#990000])+[/color][COLOR=#FF0000]', '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]0[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getFullYear[/color][/b][COLOR=#990000]()+[/color][COLOR=#FF0000]' - '[/color][COLOR=#990000]+[/color]
[tab][tab][tab][tab][tab][tab][tab][tab][tab][tab]dates[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getDate[/color][/b][COLOR=#990000]()+[/color][COLOR=#FF0000]' '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getMonthName[/color][/b][COLOR=#990000]([/color][b][COLOR=#0000FF]true[/color][/b][COLOR=#990000])+[/color][COLOR=#FF0000]', '[/color][COLOR=#990000]+[/color]dates[COLOR=#990000][[/color][COLOR=#993399]1[/color][COLOR=#990000]].[/color][b][COLOR=#000000]getFullYear[/color][/b][COLOR=#990000]());[/color]
[COLOR=#FF0000]}[/color]

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Web & Tech
 
Perfect, thank you so much! I was close, but not close enough!

Very best wishes,

Graham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top