0
Engaged
,
/t5/coldfusion-discussions/lt-a-href-and-onclick-quot-javascript/td-p/144655
Oct 23, 2006
Oct 23, 2006
Copy link to clipboard
Copied
Hi,
Again a calendar application question. I have a dynamic table representing the month, created through cfloop. I want to give the user the choice to select a date and when they click on "weekly view" on top it shows the week pertaining to that date. This perforce has to be through javascript. For my link to work for users with javascript disabled, I want the link to point to the first week of that month. Something like this:
<ahref ="weeklycalendar.cfm?month=#currentmonth#&year=currentyear#&day=1" onclick ="javascript"weeklcal()>
The javascript picks up the selected cell of the table and hence the selected date. It has the same parameters as the href except that the day is the selected date and not 1.
Can this be made to work. Any suggestions, advice,opinions would be greatly appreciated.
Thx in advance
Again a calendar application question. I have a dynamic table representing the month, created through cfloop. I want to give the user the choice to select a date and when they click on "weekly view" on top it shows the week pertaining to that date. This perforce has to be through javascript. For my link to work for users with javascript disabled, I want the link to point to the first week of that month. Something like this:
<ahref ="weeklycalendar.cfm?month=#currentmonth#&year=currentyear#&day=1" onclick ="javascript"weeklcal()>
The javascript picks up the selected cell of the table and hence the selected date. It has the same parameters as the href except that the day is the selected date and not 1.
Can this be made to work. Any suggestions, advice,opinions would be greatly appreciated.
Thx in advance
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Engaged
,
Oct 23, 2006
Oct 23, 2006
Found the solution, just incase anyone else is interested:
You use- return false and everything degrades gracefully. For users with javascript enabled, the javascript works and the href doesn't , and for users with javascript disabled, the href works.
The synatx would be something like
cfoutput><ahref ="weeklycalendar.cfm?month=#currentmonth#&year=#currentyear#&day=1" onclick ="javascript:weeklcal(); return false"></cfoutput>
You use- return false and everything degrades gracefully. For users with javascript enabled, the javascript works and the href doesn't , and for users with javascript disabled, the href works.
The synatx would be something like
cfoutput><ahref ="weeklycalendar.cfm?month=#currentmonth#&year=#currentyear#&day=1" onclick ="javascript:weeklcal(); return false"></cfoutput>
_mista_
AUTHOR
Engaged
,
/t5/coldfusion-discussions/lt-a-href-and-onclick-quot-javascript/m-p/144656#M13271
Oct 23, 2006
Oct 23, 2006
Copy link to clipboard
Copied
This should have been
<cfoutput><ahref ="weeklycalendar.cfm?month=#currentmonth#&year=#currentyear#&day=1" onclick ="javascript"weeklcal()></cfoutput>
<cfoutput><ahref ="weeklycalendar.cfm?month=#currentmonth#&year=#currentyear#&day=1" onclick ="javascript"weeklcal()></cfoutput>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
LATEST
/t5/coldfusion-discussions/lt-a-href-and-onclick-quot-javascript/m-p/144657#M13272
Oct 23, 2006
Oct 23, 2006
Copy link to clipboard
Copied
Found the solution, just incase anyone else is interested:
You use- return false and everything degrades gracefully. For users with javascript enabled, the javascript works and the href doesn't , and for users with javascript disabled, the href works.
The synatx would be something like
cfoutput><ahref ="weeklycalendar.cfm?month=#currentmonth#&year=#currentyear#&day=1" onclick ="javascript:weeklcal(); return false"></cfoutput>
You use- return false and everything degrades gracefully. For users with javascript enabled, the javascript works and the href doesn't , and for users with javascript disabled, the href works.
The synatx would be something like
cfoutput><ahref ="weeklycalendar.cfm?month=#currentmonth#&year=#currentyear#&day=1" onclick ="javascript:weeklcal(); return false"></cfoutput>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

