controller" but I guess that's completely out of the question.
(Overbearing, indeed.)
You might best seek help from complete strangers by, at minimum,
stating what it is that is not working for you. A plus would to not
come off as if we owe you anything. The only thing keeping me from
deleting this is the fact that it was so damned amusing.
The paths to the JS files are incorrect. Leave off the ".js"
extension: $javascript->link("cal2")
Do that and check with Firebug or FF Webdeveloper extension to ensure
the files were found.
Is the img path correct?
Keep in mind that, given that Cake is a PHP (that's not shouting, it's
an acronym) framework, you shouldn't expect too much help with your
javascript if, in fact, Cake is loading your files properly.
Oh, and please read this:
http://www.catb.org/~esr/faqs/smart-questions.html
On Tue, Mar 3, 2009 at 5:55 PM, Turney <turney1977@gmail.com> wrote:
>
> Hello to all,
> Is it just me or is using javascript in CakePHP impossible. Here is
> what I'm trying to do and I will be a detailed as I can.
>
> I have coded in php before and I have used some javascript to produce
> a Calendar widget on the screen when a user clicks on a image (a mini
> calendar image). Here is a snippet of that code (this would be in
> HTML)
>
> <SCRIPT src="cal2.js" type='text/javascript'></SCRIPT>
> <SCRIPT Language="JavaScript">
> //Define calendar(s): addCalendar ("Unique Calendar
> Name", "Window title", "Form element's name", Form name")
> addCalendar("Calendar1", "Select Date", "shipDate",
> "BackOrderCreateForm");
> setFormat("yyyymmdd");
> setSize(200, 200, -200, -200);
> addCalendar("startDate", "Select Start Date",
> "startDate", "itemSoldVendoReport");
> addCalendar("endDate", "Select End Date", "endDate",
> "itemSoldVendoReport");
> </SCRIPT>
>
> .....
> then further along in the file I do the following.....
>
> Please enter a start date: (yyyymmdd) <input type='text'
> id='startDate' size='8' name='startDate' value='<? print getStartDate
> (); ?>'> <a href="javascript:showCal('startDate')"><IMG
> SRC="calendar.gif" BORDER="0"></a>
>
> Now, I have followed the SCARCE DOCUMENTATION ON JAVASCRIPT HELPER in
> the CakePHP documentation with NO SUCCESS. (documentation for cakephp
> sucks the big one).
>
> So here is my question, how do I use this cal2.js file to produce a
> visual calendar on clicking a calendar image, then returning the
> correct value to populate a value before a html post?
>
> So far I have something like this..... this is in MY HTML VIEW
>
> <? echo $javascript->link("cal2.js");?>
> <? echo $javascript->codeblock("
> setFormat('yyyymmdd');
> setSize(200, 200, -200, -200);
> addCalendar('RYAN', 'Select Start Date', 'selected_start_date',
> 'StoredFileIndexForm');
> ",false);
> ?>
>
> .......
>
> then I have further along in that view.....
>
> echo $html->image('calendar.gif');
> echo $javascript->codeblock("showCal('RYAN');");
>
> Please let me know if anyone can help on this. NO I'm not going to
> write and overbearing controller for something in normal html i had
> working with 7 lines of code. Plus most of the documentation out
> there is dealing with Ajax, no straight on javascript.
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment