473,725 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Coldfusion & Javascript

Hello,

I have date fields on a form which is generated by a Coldfusion custom
tag (another piece of code). I want to change something else on the
form when the user changes the date. But, how do I generate an
onChange() event on this field (since I only have the call to the
custom tag in this form)?

Thanks in advance for any suggestions.

Jnag

Mar 21 '07 #1
4 2121
"jnag" <pr******@gmail .comwrote in news:1174505780 .987236.193340
@l77g2000hsb.go oglegroups.com:
Hello,

I have date fields on a form which is generated by a Coldfusion custom
tag (another piece of code). I want to change something else on the
form when the user changes the date. But, how do I generate an
onChange() event on this field (since I only have the call to the
custom tag in this form)?

Thanks in advance for any suggestions.
Try this JS (note: execute this line *after* the form has loaded):

document.forms['TheFormName'].elements['TheDateFieldNa me'].onclick =
whatYouWantToDo ;
Mar 21 '07 #2
Jim Land said the following on 3/21/2007 5:10 PM:
"jnag" <pr******@gmail .comwrote in news:1174505780 .987236.193340
@l77g2000hsb.go oglegroups.com:
>Hello,

I have date fields on a form which is generated by a Coldfusion custom
tag (another piece of code). I want to change something else on the
form when the user changes the date. But, how do I generate an
onChange() event on this field (since I only have the call to the
custom tag in this form)?

Thanks in advance for any suggestions.

Try this JS (note: execute this line *after* the form has loaded):

document.forms['TheFormName'].elements['TheDateFieldNa me'].onclick =
whatYouWantToDo ;
It would seem to be a better idea to use the onload event of the window
to trigger a function to set it. Then you know, for sure, that it is
available for scripting.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 21 '07 #3
On Mar 21, 5:10 pm, Jim Land <rrrrfffftttt(n o)@(spam)hotmai l.com>
wrote:
"jnag" <prajy...@gmail .comwrote in news:1174505780 .987236.193340
@l77g2000hsb.go oglegroups.com:
Hello,
I have date fields on a form which is generated by a Coldfusion custom
tag (another piece of code). I want to change something else on the
form when the user changes the date. But, how do I generate an
onChange() event on this field (since I only have the call to the
custom tag in this form)?
Thanks in advance for any suggestions.

Try this JS (note: execute this line *after* the form has loaded):

document.forms['TheFormName'].elements['TheDateFieldNa me'].onclick =
whatYouWantToDo ;
Thank you very much for this suggestion. It works partially (in that,
before I was not able to even fire the event). But, it is implementing
the event function before the form comes up. I want it to happen when
the user changes the date. I have included this line after the
<form...tag just where the date field tag is defined. Is this
probably because the date field is part of the server side custom tag
which has already been executed? Thanks.

Mar 22 '07 #4
"jnag" <pr******@gmail .comwrote in news:1174573152 .118201.37600
@l75g2000hse.go oglegroups.com:
On Mar 21, 5:10 pm, Jim Land <rrrrfffftttt(n o)@(spam)hotmai l.com>
wrote:
>"jnag" <prajy...@gmail .comwrote in news:1174505780 .987236.193340
@l77g2000hsb.g ooglegroups.com :
I have date fields on a form which is generated by a Coldfusion
custom
tag (another piece of code). I want to change something else on the
form when the user changes the date. But, how do I generate an
onChange() event on this field (since I only have the call to the
custom tag in this form)?
>Try this JS (note: execute this line *after* the form has loaded):

document.forms['TheFormName'].elements['TheDateFieldNa me'].onclick =
whatYouWantToD o;

Thank you very much for this suggestion. It works partially (in that,
before I was not able to even fire the event). But, it is implementing
the event function before the form comes up. I want it to happen when
the user changes the date. I have included this line after the
<form...tag just where the date field tag is defined. Is this
probably because the date field is part of the server side custom tag
which has already been executed? Thanks.
I think you need to put the onclick line of code much later in the page.
Try just above the /html tag at the end of the page. Or, as Randy
suggested, put it in the body onload event. By then the form will be
completely loaded and any changes the user makes will trigger your
onclick event.

Mar 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3059
by: entact | last post by:
I've got a simple coldfusion query output (title, id and disclaimer) that I use to dynamically populate a select box with the title using the id as the value. What I need is to use javascript to populate a second text field with the disclaimer when any of the selections are changed ( so a page reload is not needed). Thanks for help!
4
3227
by: johkar | last post by:
When the output method is set to xml, even though I have CDATA around my JavaScript, the operaters of && and < are converted to XML character entities which causes errors in my JavaScript. I know that I could externalize my JavaScript, but that will not be practical throughout this application. Is there any way to get around this issue? Xalan processor. Stripped down stylesheet below along with XHTML output. <?xml version='1.0'?>...
2
2206
by: am_pcguy | last post by:
I have a web based application for my company. We use Coldfusion, I wanted to see if I could use Javascript to make the page a bit more dynamic. Right now I use the command: <cfhttp URL="http://server:port" method="get" Timeout="20" charset="UTF-8"> <cfhttpparam name="var" type="CGI" value="command I send"> this connects to an application on another server listening on the provided port for a request. When it sees the command a...
7
8230
acoder
by: acoder | last post by:
This page will link to a number of tutorials. Coldfusion Language Coldfusion Variables Using Coldfusion Variables Coldfusion Image Gallery How to upload a file in Coldfusion How to send mail using Coldfusion Coldfusion Tips and Tricks
3
21034
by: jnag | last post by:
Hello, I have a website with various font options (small to large) buttons that the user can click on the banner, which runs through the site. Site contains both static and dynamic content. I have an onclick() event on the buttons. But, I am not sure where to put the javascript function that will change the stylesheet accordingly and how to write this piece of code. Any help is appreciated. Thanks,
1
1956
by: jnag | last post by:
Hello, I have implemented styleswitcher.js on my coldfusion website. The code looks perfectly ok, but the stylesheets are not taking effect. Basically, nothing changes when I click on the buttons on the banner to switch styles. My friend has implemented the exact same thing on a basic HTML website and it works perfectly well.
7
8780
by: kmitchell00 | last post by:
I am coding in Coldfusion MX7 and using Javascript for some of the functionality. The basic functionality I'm coding is, based on a value the user chooses from a dropdown box, I populate address fields with the associated data. I am using the onChange attribute of the dropdown box for the call to a Javascript function. I prepopulate a Coldfusion array with the address data and am using cfwddx to convert the Coldfusion array to a Javascript...
2
4079
by: quest007 | last post by:
Hi! I have configured IIS for coldfusion and when I access my coldfusion site through localhost, the pages are served as required. But if i ty to access it from a remote machine by specifying the IP address in the url, it displays an error: The web site you are accessing has experienced an unexpected error. File not found: /mysite/htdocs/dsp_welcome.cfm While searching for the error, I found a solution which suggests that it might be...
106
19802
by: bonneylake | last post by:
Hey Everyone, Well i don't know if my question should be in javascript/ajax or coldfusion, i figure this is more of a coldfusion question. But if this is in the wrong section let me know an all gladly delete my question an put it in the correct section. Well what i am trying to do is pretty simple. I have a input field and someone starts typing in a customer number. As they type in the customer number the drop down box is populated. They...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9113
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.