Solved

Restrict Access to Form Submit Button using CF?

Posted on 2004-03-26
5
218 Views
Last Modified: 2013-12-24
hello.
I need to activate (show or hide?) a FORM's submit button IF a condition exsists or does not exist (someone voting on a sample poll already ... means HIDE the submit button so they cannot vote again).

Any ideas how / if / I can do this using CF!? else!?

Thanks much!
Richard
0
Comment
Question by:rcbuchanan
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
M256 earned 300 total points
Comment Utility
If you want to do it on the Client side, you need JavaScript.

Otherwise, you could use the following ColdFusion code:

<cfparam name="session.voted" default="false">
<form>
<input type="text"><br>
<cfif session.voted is false>
<input type="submit">
</cfif>
</form>

Put this line on the action page of the form:
<cfset session.voted = true>

Matthew
0
 
LVL 9

Assisted Solution

by:CFDevHead
CFDevHead earned 200 total points
Comment Utility
<cfparam name="cookie.vote" default="">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Vote Now</title>
</head>

<body>
      <form name="frmMain" action="index.cfm" method="post"<cfif cookie.vote is ""> onSubmit="return false;"</cfif>>
      
      <cfif cookie.vote is "">
      <input type="submit" value="vote">      
      </cfif>
      </form>
</body>
</html>
0
 
LVL 9

Expert Comment

by:CFDevHead
Comment Utility
Similar to M256
0
 

Author Comment

by:rcbuchanan
Comment Utility
Thanks guys!
Is perfect.
0
 
LVL 5

Expert Comment

by:M256
Comment Utility
rcbuchanan,

Glad to help.

Matthew
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now