Solved

Restrict Access to Form Submit Button using CF?

Posted on 2004-03-26
5
223 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
M256 earned 300 total points
ID: 10692277
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
ID: 10692306
<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
ID: 10692313
Similar to M256
0
 

Author Comment

by:rcbuchanan
ID: 10692431
Thanks guys!
Is perfect.
0
 
LVL 5

Expert Comment

by:M256
ID: 10692448
rcbuchanan,

Glad to help.

Matthew
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

724 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