?
Solved

Restrict Access to Form Submit Button using CF?

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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
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…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

752 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