CalendarXP.net Support Forum Index CalendarXP.net Support
Most forums here are private and invisible to public.
 
 FAQFAQ   SearchSearch   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How can I submit (autopost) the form as soon as the calendar icon is clicked?

 
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related
View previous topic :: View next topic  
Author Message
lenkp



Joined: 03 Sep 2007
Posts: 3
Location: Maryland

PostPosted: Thu Sep 06, 2007 6:43 am    Post subject: How can I submit (autopost) the form as soon as the calendar icon is clicked? Reply with quote

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
View user's profile Send private message
calendarxp
Site Admin


Joined: 30 Jan 2005
Posts: 409

PostPosted: Thu Sep 06, 2007 12:54 pm    Post subject: Reply with quote

You kind of need AJAX to fulfill the task. The steps are as following:


  1. 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.
  2. 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.
  3. 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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    CalendarXP.net Support Forum Index -> PopCalendarXP Related All times are GMT
Page 1 of 1

 
Jump to:  
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