473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Passing javascript value to coldfusion variable on same page?

219 100+
I'm assuming I can't pass a javascript variable to a cf variable on the same page because js is client and cf is server correct?

I've got a drop down list which I want it to populate a form on the same page when the user selects a new value.
Oct 24 '07 #1
5 7406
acoder
16,027 Expert Mod 8TB
This should be possible using Ajax. Can you show your code?
Oct 25 '07 #2
dmorand
219 100+
This should be possible using Ajax. Can you show your code?
Here is the code snippet:

Expand|Select|Wrap|Line Numbers
  1. function readOption(which){
  2.     var accessID = which.value;    
  3.     alert(accessID);
  4.         //#accID# = accessID;
  5.  
Expand|Select|Wrap|Line Numbers
  1.     <select name="retRequest" onChange="readOption(this)">
  2.         <cfoutput query="retRequests">
  3.             <cfset #displayDate# = #DateFormat(#reqDate#,"mm-dd-yyyy")#>
  4.             <option value=#accID#>#displayDate#  &nbsp; #empLastName#,#empFirstName#</option>
  5.         </cfoutput>
  6.     </select>
  7.  
Should I go ahead and start learning ajax and forget about javascript? I'll have to read up on what exactly ajax does. I'm not that familiar with it. I've heard a lot about ajax and ruby so I guess I should dive in now.
Oct 25 '07 #3
acoder
16,027 Expert Mod 8TB
So once you have accessID, why does a Coldfusion variable need to be set?
Should I go ahead and start learning ajax and forget about javascript?
The J in AJAX is JavaScript. You use JavaScript for the client-side aspect of AJAX.
Oct 25 '07 #4
dmorand
219 100+
I need the accessID value because it's the key value I need to query off of. It's going to be in a

Expand|Select|Wrap|Line Numbers
  1. <cfquery name="retRequests" datasource="Security_Access" dbtype="ODBC">
  2.     SELECT reqDate,reqBy,empLastName,empFirstName from tblAccessRequest
  3.     where accID = #accessID#</cfquery>
  4.  
Oct 25 '07 #5
acoder
16,027 Expert Mod 8TB
This is a JavaScript problem, so I'm moving this to the JavaScript/AJAX forum.

Check out this AJAX example and the AJAX tutorials in the Offsite Links sticky in the JavaScript forum.
Oct 25 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
29
by: wayne | last post by:
Hey there... I'm having some problems passing url parameters with an open.window command. I'm not terribly familiar with java script but here is the code below. When executed it opens the...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
2
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...
7
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...
9
by: ismailc | last post by:
Hi, I need help please I usually code in coldfusion but now i want to create 2 text html files where i pass a parameter on href? This normally works in coldfusion! Page1 <a...
5
by: aelred | last post by:
I have a web page where a member can open up a chat window (child window) with another member. - From there the member can also navigate to other web pages. - From other pages in the site, they...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.