|
CalendarXP.net Support Most forums here are private and invisible to public.
|
View previous topic :: View next topic |
Author |
Message |
lenkp
Joined: 03 Sep 2007 Posts: 3 Location: Maryland
|
Posted: Thu Sep 06, 2007 6:43 am Post subject: How can I submit (autopost) the form as soon as the calendar icon is clicked? |
|
|
I'm new to programming & PHP so please bear with me. I've reviewed the messages in the knowlege base but no luck. This is similar to customizing a calendar for every UserID ("http://www.calendarxp.net/forum/viewtopic.php?t=48"). The only problem is that I do not know how to pass a parameter from my Form to the AGENDA PHP script as soon as the end-user clicks the Calendar icon. This is needed so I can dynamically build the calendar.
PROBLEM:
Using the online documentation, I have successfully configured the PopCalendar to dynamically generate the AGENDA.PHP from AGENDA.JS and data stored in MySQL database. I am trying to use a field in my Form (zip code) to build the SQL "WHERE" clause. The problem is that I do not know how to get the information into the WHERE clause from my Form field. (Also, if you know of a better way to do this, then I am all ears!). My form field is "errandsform.zip"
My select statement is:
$query="SELECT * FROM my_agenda where ag_zip = '$phpzip'";
How do I populate $phpzip with the zip code in my form field called "errandsform.zip" so that when a user first clicks on the calendar icon he/she is presented with a calendar of events/agenda items related to their zip code?
Any (detailed) help would be much appreciated. Thank you for your patience. -paul
|
|
Back to top |
|
|
calendarxp Site Admin
Joined: 30 Jan 2005 Posts: 409
|
Posted: Thu Sep 06, 2007 12:54 pm Post subject: |
|
|
You kind of need AJAX to fulfill the task. The steps are as following:
- create a php script, say "zipEvents.php", that take a zip parameter and generate "gfPop.fAddEvent(...)" calls using sql query. Note that it's similar to agenda.php but you need to prepend "gfPop." to each and every function calls.
- set up the onclick event of the icon to collect the zip code field from your form and send it to your php script via AJAX call.
- execute the return string by using "eval()", and only pops up the calendar after that.
The downside of it is the calendar will not be popped up immediately after click, which may confuse the end user.
Another better way is if you know the zip code before entering the page with calendar, then you may simply pass the zip to the agenda.php in iframe tag and user will see the calendar with desired events immediately.
_________________ Copyright 2003-2011 Idemfactor Solutions, Inc. All rights reserved. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
|
Copyright 2003- Idemfactor Solutions, Inc. All rights reserved.
Powered by phpBB © 2001, 2005 phpBB Group
|