I'm trying to pass a date/time value to a page so I can refresh the page based on the date/time selected by the user.
I'm using client variables for now, but I have to have the form at the bottom of the page so that when I hit the refresh button the date/time is used.
Is there a way to pass the value in the URL? -
<form method="post" action="BigPic_dt_v2.cfm?refDT=#PDT#">
-
</cfoutput>
-
<SELECT name="ed_dt">
-
<option>Select a Date/Time</option>
-
<cfoutput query="getEDV2_dt">
-
<cfset ed_date=#DateFormat(date,"mm-dd-yy")#>
-
<cfset ed_time=#TimeFormat(time,"HH:mm")#>
-
<cfset DT=#ed_date# & ' ' & #ed_time#>
-
<option>#DT#</option>
-
<cfset #PDT# = #ed_dt#>
-
</cfoutput>
-
</SELECT>
-
<input type="submit" value="Refresh">
-
<cfif isDefined("ed_dt")>
-
<cfset #CLIENT.ED_Date_Time# = #ed_dt#>
-
</cfif>
-
<cfoutput>PDT = #PDT#</cfoutput>
-
</form>
-
I'm trying to pass the PDT value, but it doesn't get set until after the Refresh button has been pressed. Is there a way to read the value out before the refresh is pressed?
9 6685
You can use JavaScript to read the value before refresh is pressed.
If you want to pass the value in the URL, use GET instead of POST as the form method.
You can use JavaScript to read the value before refresh is pressed.
If you want to pass the value in the URL, use GET instead of POST as the form method.
javascript is really the only option I have to pass the value from the select list?
I just want to pass the key value in the url for the item the user selects. -
<cfoutput>
-
<form method="post" action="systemMaint.cfm?sysID=#form.system#">
-
</cfoutput>
-
<SELECT name="system">
-
<option>Select a System</option>
-
<cfoutput query="getSystems">
-
<option>#name#</option>
-
</cfoutput>
-
</SELECT>
-
<input type="submit" name="Edit" value="Edit">
-
<input type="submit" name="Delete" value="Delete">
-
</form>
-
In that case, use "get" as the form method instead of "post".
On the action page, use "url.variable" to retrieve the values.
In that case, use "get" as the form method instead of "post".
On the action page, use "url.variable" to retrieve the values.
Ok lets see if I can pick your brain once again.
I have a list which contains the names from a table, but I need to pass the key value to a page, not the entry which is listed in the list. The option I came up with is to place the key value into the select list with the name and then parse out the key in the javascript. I'm assuming there's a better way to do this right?
The value I want to pass is the #sysID#, but I'd rather not have it displayed in the dropdown menu. -
<cfoutput>
-
<form name="selectSys" method="get" action="systemMaint.cfm?sysID=14">
-
</cfoutput>
-
<SELECT name="system" onChange="readValue()">
-
<option>Select a System</option>
-
<cfoutput query="getSystems">
-
<option>#sysID# - #name#</option>
-
</cfoutput>
-
</SELECT>
-
<input type="submit" name="Edit" value="Edit">
-
<input type="submit" name="Delete" value="Delete">
-
<input type="text" name="systemID">
-
</form>
-
-
<script language="javascript">
-
-
//window.location.href=window.location.href
-
-
function readValue(){
-
var n = selectSys.system.selectedIndex; //get selected index value
-
var val = selectSys.system[n].text; //get selected value
-
var temp=new Array();//split the value up by character
-
temp=val.split(' ');
-
alert(temp[0] + ' ' + temp[1]);
-
selectSys.sysID.value=temp[0];
-
}
-
</script>
-
Heya check this out: -
<html>
-
<head>
-
<script type="text/javascript">// ALWAYS USE LIKE THIS
-
function readValue(value){
-
alert(value)//JUST TO PRINT
-
}
-
</script>
-
</head>
-
-
<body>
-
<!--Only systemMaint.cfm is enough for pass the selcted parameters when deal with GET -->
-
<form name="selectSys" method="get" action="systemMaint.cfm">
-
<!--Sorry ! I removed some <TAGS> -->
-
<SELECT name="system" onChange="readValue(this.value)">
-
<option>Select a System</option>
-
-
<option value="1001">Name for id 1001</option>
-
<option value="1002">Name for id 1002</option>
-
<option value="1003">Name for id 1003</option>
-
-
</SELECT>
-
<input type="submit" name="Edit" value="Edit">
-
<input type="submit" name="Delete" value="Delete">
-
<input type="text" name="systemID">
-
</form>
-
</body>
-
</html>
-
-
Heya check this out: -
<html>
-
<head>
-
<script type="text/javascript">// ALWAYS USE LIKE THIS
-
function readValue(value){
-
alert(value)//JUST TO PRINT
-
}
-
</script>
-
</head>
-
-
<body>
-
<!--Only systemMaint.cfm is enough for pass the selcted parameters when deal with GET -->
-
<form name="selectSys" method="get" action="systemMaint.cfm">
-
<!--Sorry ! I removed some <TAGS> -->
-
<SELECT name="system" onChange="readValue(this.value)">
-
<option>Select a System</option>
-
-
<option value="1001">Name for id 1001</option>
-
<option value="1002">Name for id 1002</option>
-
<option value="1003">Name for id 1003</option>
-
-
</SELECT>
-
<input type="submit" name="Edit" value="Edit">
-
<input type="submit" name="Delete" value="Delete">
-
<input type="text" name="systemID">
-
</form>
-
</body>
-
</html>
-
-
I need to have #name# in my option from my query though. what are those options going to do "Name for id 1003"? Was that just an example you were showing me?
I need to have #name# in my option from my query though. what are those options going to do "Name for id 1003"? Was that just an example you were showing me?
O Ok, I get it now. i'm a moron once again
-
<option value="real_value_goes_here">display_value_goes_here</option>
-
It's just an example,Thanks!
-
<option value="real_value_goes_here">display_value_goes_here</option>
-
It's just an example,Thanks!
Yeah I realized that after. I think it's just that my brain doesn't work on the weekends, lol.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Paul |
last post by:
I want to use sessions to cover myself in case the user switches off cookies
so I am passing the session ID manually through a hidden input field. This
is what I have so far.
index.php page...
|
by: Paul |
last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and
session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
|
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...
|
by: Jack |
last post by:
Hi,
I need to pass multple variables in a link in order to go to a asp page with
the
two varables.
The following are the values of the variables using response.write:
<%'Response.Write Mypage...
|
by: Gordon Hudson |
last post by:
Hello
Here is what I am trying to do:
Make a hyperlink on a data entry form with its URL built from the values for
fields in that entry on the database.
So, I would go to record 65785 click...
|
by: Anne |
last post by:
hie there, i want to be able to pass multiple parameters
to another page. currently, i am able to do so, but
somehow i feel it is not the correct way to do it. below
is part of what i have so far....
|
by: Russell |
last post by:
Hi there,
I'm currently creating a .NET Web Application and I have a question about
passing values from one screen to another. I previously used Session
variables in the code to store these...
|
by: olduncleamos |
last post by:
Hello all.
With a background in ASP, I am finding the work required for passing
values between pages mystifying. For various obvious reasons, I have
eliminated using cookies and session to store...
|
by: Ganesh |
last post by:
Hi there,
I'm new to .net just started with 2005 and asp.net 2.0, I'm passing control
values to other page to retrieve the data from data set based on the passing
values. It works fine. But when...
|
by: jmartmem |
last post by:
Greetings,
I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few.
Upon clicking the 'submit' button, I want the...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
|
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...
|
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...
| |