[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Restrict Access to Form Submit Button using CF?

Posted on 2004-03-26
5
Medium Priority
?
225 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 1200 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 800 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 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