Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old October 29th, 2009, 08:03 PM
LLX LLX is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,270 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 10 h 6 m 51 sec
Reputation Power: 4
Send a message via AIM to LLX Send a message via Yahoo to LLX
Javascript - Date Picker problem

So I picked up a bit of code here for a date picker

http://www.triconsole.com/php/calendar_datepicker.php

and while the icon for the calander shows up and the java script for it loads a ifram when i click on it the page it loads gives me a internal server error. I'm tearing my hair out trying to figure out what i'm doing wrong. Ive tied putting Calader form inside the classes folder, outside. Manually set the path. Nothing works.

As a point of reference this is the bit of code that pulls out the form, everything works the way it should except it doesn show the dang calander page

PHP Code:
echo '<h2>Add '.$pagetitle.'</h2>';
echo 
'<BR><BR><form enctype="multipart/form-data" method="POST">';
echo 
'<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />';
echo 
'<B>Name:</B> <input type="text" name="Name"><BR>';
echo 
'<B>Pic:</B> <input type="file" name="Image"><BR>';
echo 
'<B>Intro:</B> <TEXTAREA Cols=40 rows=20 name="Intro"></TEXTAREA><BR>';
echo 
'<B>Status:</B> <select name="Status">';
for (
$x=0$x 2$x++){
echo 
'<option value="'.$x.'">'.IssueStatus($x).'</option>';
};
echo 
'</select><BR>';
include (
'classes/tc_calendar.php');
?>
                <div style="float: left;">
                  <div style="float: left; padding-right: 3px; line-height: 18px;">Deadline:</div>
                  <div style="float: left;">
                    <?php
      $myCalendar 
= new tc_calendar("date3"truefalse);
      
$myCalendar->setIcon("images/iconCalendar.gif");
      
//$myCalendar->setDate(1, 1, 2010);
      
$myCalendar->setPath("");
      
$myCalendar->setYearInterval(19702020);
      
//$myCalendar->dateAllow('2009-02-20', "", false);
      
$myCalendar->writeScript();      
      
?>
                  </div>
                </div>
                <div style="float: left;">
                  <div style="float: left; padding-left: 3px; padding-right: 3px; line-height: 18px;">Drawing date:</div>
                  <div style="float: left;">
                    <?php
      $myCalendar 
= new tc_calendar("date4"truefalse);
      
$myCalendar->setIcon("images/iconCalendar.gif");
      
//$myCalendar->setDate(1, 1, 2010);
      
$myCalendar->setPath("");
      
$myCalendar->setYearInterval(19702020);
      
//$myCalendar->dateAllow("", '2009-11-03', false);
      
$myCalendar->writeScript();      
      
?>
                  </div>
                </div>
                <p>
                  <input type="button" name="button2" id="button2" value="Check the value" onClick="javascript:alert('Date select from '+this.form.date3.value+' to '+this.form.date4.value);">
<?
echo '<input type="submit" name="submit" value="Submit" /></form>'
__________________
29 years of creative writing
13 years of HTML
10 years of Photoshop
6 years of PHP/MySQL
And I never knew Photoshop could do HTML until 2004!
You learn something new every day.

Reply With Quote
  #2  
Old November 12th, 2009, 04:42 PM
LLX LLX is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,270 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 10 h 6 m 51 sec
Reputation Power: 4
Send a message via AIM to LLX Send a message via Yahoo to LLX
just popping in to say "yup the dang thing still has me beat"

Reply With Quote
  #3  
Old November 12th, 2009, 06:02 PM
IAmALlama IAmALlama is offline
Me
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937 IAmALlama User rank is Private First Class (20 - 50 Reputation Level)IAmALlama User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 4
I have never liked using an iframe for things like this. when changing months, it loads a new page in the frame and when you click the back button it just goes back in the iframe first because each page load in the iframe goes into the history. I prefer a pure JS method. I personally would just write my own calendar or because I use jquey to handle my javascript I might use the pre-made jquery UI date picker. http://jqueryui.com/demos/datepicker/

Reply With Quote
  #4  
Old November 13th, 2009, 02:40 PM
LLX LLX is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,270 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 10 h 6 m 51 sec
Reputation Power: 4
Send a message via AIM to LLX Send a message via Yahoo to LLX
Quote:
Originally Posted by IAmALlama
I have never liked using an iframe for things like this. when changing months, it loads a new page in the frame and when you click the back button it just goes back in the iframe first because each page load in the iframe goes into the history. I prefer a pure JS method. I personally would just write my own calendar or because I use jquey to handle my javascript I might use the pre-made jquery UI date picker. http://jqueryui.com/demos/datepicker/


to use that what would i have to install, like a jqury library or something?

Reply With Quote
  #5  
Old November 13th, 2009, 05:30 PM
IAmALlama IAmALlama is offline
Me
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937 IAmALlama User rank is Private First Class (20 - 50 Reputation Level)IAmALlama User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 4
you just need to download the jquery file and the jquery ui file. they are JS files so you just need to put a script tag in the head section of the page to load it. Looks like if you go to the jquery ui website and click download, you can specify all kinds of stuff and it includes all the files needed as well as you can select a design/theme for stuff like the date picker and it does everything for you and you just download a zip with all the files needed.
Code:
<html>
<head>
<script type="text/javascript" src="/path/to/js/jquery.js"></script>
<script type="text/javascript" src="/path/to/js/jquery.ui.js"></script>
<script type="text/javascript">
//javascript stuff goes here to initialize program.
</script>
</head>
<body>
</body>
</html>

Reply With Quote
  #6  
Old November 13th, 2009, 05:44 PM
LLX LLX is offline
Contributing User
Click here for more information.
 
Join Date: Apr 2007
Location: Glendale, CA, USA
Posts: 1,270 LLX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 10 h 6 m 51 sec
Reputation Power: 4
Send a message via AIM to LLX Send a message via Yahoo to LLX
Quote:
Originally Posted by IAmALlama
you just need to download the jquery file and the jquery ui file. they are JS files so you just need to put a script tag in the head section of the page to load it. Looks like if you go to the jquery ui website and click download, you can specify all kinds of stuff and it includes all the files needed as well as you can select a design/theme for stuff like the date picker and it does everything for you and you just download a zip with all the files needed.
Code:
<html>
<head>
<script type="text/javascript" src="/path/to/js/jquery.js"></script>
<script type="text/javascript" src="/path/to/js/jquery.ui.js"></script>
<script type="text/javascript">
//javascript stuff goes here to initialize program.
</script>
</head>
<body>
</body>
</html>


thanks, i'll check it out later...

One of these days i really need to learn JS, it can't be more complex that C++, Basic, and PHP ;)

Reply With Quote
  #7  
Old November 13th, 2009, 06:48 PM
IAmALlama IAmALlama is offline
Me
Click here for more information. Click here for more information
Click here for more information
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 1,937 IAmALlama User rank is Private First Class (20 - 50 Reputation Level)IAmALlama User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 5 Days 1 h 54 m 18 sec
Reputation Power: 4
its much easier, especially if you learn a library like jquery that does all the hard stuff for you like differences in browsers.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Javascript - Date Picker problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek