Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Problems implementing Tigra Calendar in php
Halfdan
Junior Member

Posts: 3
Registered: 4/11/2008
Location: Alabama USA
Member Is Offline
posted on 4/11/2008 at 11:48 PM
Problems implementing Tigra Calendar in php


I am trying to add the Tigra Calendar in a php file.

In the <head></head> area I added

<script language="JavaScript" src="calendar2.js"></script>

Within the <form></form> area I have added the call for the calendar:

<input type="Text" name="eventdate" size="10" value="mm/dd/yyyy">
<a href="javascript:cal1.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click here to pick the date"></a>


After the close </form> I have added:

</form>
<script language="JavaScript">
var cal1 = new calendar2(document.forms['myformname'].elements['eventdate']);
</script>
</body>
</html>';

However, when I try to view the uploaded page, I get only this error:

Parse error: syntax error, unexpected T_STRING in /home/ssai/www/swordswallow.org/ceibookingrequest.php on line 670

I will admit that I am not a php guru. But the original php form page has been working fine before I attempted to add the Tigra calendar, and a test of Tigra calendar in a regular .html page worked perfectly.

All I can figure is that somehow the php code does not like the code in the <script> area after the </form>. Could it be the ";" that it does not like?

Any suggestions on what I am doing wrong? How do I fix it in .php?

Thanks in advance!
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 4/14/2008 at 04:52 PM

php doesn't care about what's outside of <? ?> brackets. the problem is somewhere inside the php code. you could have introduced it while copying the calendar code.
View User's Profile View All Posts By User U2U Member
Halfdan
Junior Member

Posts: 3
Registered: 4/11/2008
Location: Alabama USA
Member Is Offline
posted on 4/14/2008 at 05:37 PM

I figured out what it was...

In the chunk of code just after the closing </form> was supposed to be this code:

</form>
<script language="JavaScript">
var cal1 = new calendar2(document.forms['ceibookingrequest'].elements['eventdate']);
cal1.year_scroll = true;
cal1.time_comp = false;
</script>

However, the solution was that I needed to add \ before single '

So the final fix that works in the php looks like this:

</form>
<script language="JavaScript">
var cal1 = new calendar2(document.forms[\'ceibookingrequest\'].elements[\'eventdate\']);
cal1.year_scroll = true;
cal1.time_comp = false;
</script>

Hope this might help someone else who is putting javascript inside of html inside of php!
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Calendar
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum
 
Tigra Calendar PRO
Product Demonstrations Live Demos
Popup Calendar
Onpage Calendar
Modal Calendar
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004