Hello,
im embarrased for asking, but i just can't figure it out. It's beenalmost 2 years since i've done some cf-work.
This is the code of desktop.cfm:
*****start code*****
<cfif NOT IsDefined("form.param_status">
<cfquery name="GetStatus" datasource="Home" dbtype="ODBC">
select * from dl_status
</cfquery>
<cfelseif form.param_status EQ 'off'>
<cfquery name="PutStatus" datasource="Home" dbtype="ODBC">
Update dl_status
set status = 'off'
where status_ID = 1
</cfquery>
<cfquery name="GetStatus" datasource="Home" dbtype="ODBC">
select * from dl_status
</cfquery>
<cfelseif form.param_status EQ 'on'>
<cfquery name="PutStatus" datasource="Home" dbtype="ODBC">
Update dl_status
set status = 'on'
where status_ID = 1
</cfquery>
<cfquery name="GetStatus" datasource="Home" dbtype="ODBC">
select * from dl_status
</cfquery>
</cfif>
<cfoutput query="GetStatus">
<cfif #status# EQ 'on'>
<cfset #value2# = 'off'>
<cfset #value1# = 'on'>
<cfelse>
<cfset #value2# = 'on'>
<cfset #value1# = 'off'>
</cfif>
</cfoutput>
<html>
<head>
<title>Admin</title>
</head>
<body>
<cfoutput query="GetStatus">
<cfif #status# EQ 'on'>
Download allowed
<cfelse>
Download not allowed
</cfif>
</cfoutput>
<form action="desktop.cfm" method="post">
<select name="form_status">
<option value="<cfoutput>#value1#</cfoutput>">
<cfoutput>#value1#</cfoutput>
</option>
<option value="<cfoutput>#value2#</cfoutput>">
<cfoutput>#value2#</cfoutput>
</option>
</select>
<input type="Submit" value="Toggle" name="Submit_button">
</form>
</body>
</html>
*****end code*****
It's supposed to be able to switch the status from on to off and reverse. But i guess something goes wrong with passing the variable to the new instance of the page. I've tried stuff like: action="desktop.cfm?param_status=form.form_status" but it doesn't work either. Tomorrow i'll receive my new cf5.0 reference book, but it's not tomorrow yet (sadly). Any help is greatly appreciated.
regards wouter Wouter
zure_zult@hotmail.com
To me, boxing is like a ballet, except there's no music, no choreography, and the dancers hit each other.
im embarrased for asking, but i just can't figure it out. It's beenalmost 2 years since i've done some cf-work.
This is the code of desktop.cfm:
*****start code*****
<cfif NOT IsDefined("form.param_status">
<cfquery name="GetStatus" datasource="Home" dbtype="ODBC">
select * from dl_status
</cfquery>
<cfelseif form.param_status EQ 'off'>
<cfquery name="PutStatus" datasource="Home" dbtype="ODBC">
Update dl_status
set status = 'off'
where status_ID = 1
</cfquery>
<cfquery name="GetStatus" datasource="Home" dbtype="ODBC">
select * from dl_status
</cfquery>
<cfelseif form.param_status EQ 'on'>
<cfquery name="PutStatus" datasource="Home" dbtype="ODBC">
Update dl_status
set status = 'on'
where status_ID = 1
</cfquery>
<cfquery name="GetStatus" datasource="Home" dbtype="ODBC">
select * from dl_status
</cfquery>
</cfif>
<cfoutput query="GetStatus">
<cfif #status# EQ 'on'>
<cfset #value2# = 'off'>
<cfset #value1# = 'on'>
<cfelse>
<cfset #value2# = 'on'>
<cfset #value1# = 'off'>
</cfif>
</cfoutput>
<html>
<head>
<title>Admin</title>
</head>
<body>
<cfoutput query="GetStatus">
<cfif #status# EQ 'on'>
Download allowed
<cfelse>
Download not allowed
</cfif>
</cfoutput>
<form action="desktop.cfm" method="post">
<select name="form_status">
<option value="<cfoutput>#value1#</cfoutput>">
<cfoutput>#value1#</cfoutput>
</option>
<option value="<cfoutput>#value2#</cfoutput>">
<cfoutput>#value2#</cfoutput>
</option>
</select>
<input type="Submit" value="Toggle" name="Submit_button">
</form>
</body>
</html>
*****end code*****
It's supposed to be able to switch the status from on to off and reverse. But i guess something goes wrong with passing the variable to the new instance of the page. I've tried stuff like: action="desktop.cfm?param_status=form.form_status" but it doesn't work either. Tomorrow i'll receive my new cf5.0 reference book, but it's not tomorrow yet (sadly). Any help is greatly appreciated.
regards wouter Wouter
zure_zult@hotmail.com
To me, boxing is like a ballet, except there's no music, no choreography, and the dancers hit each other.