ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 14th, 2004, 09:09 PM
Alas's Avatar
Alas Alas is offline
Wickedwd.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: wickedwd.com
Posts: 186 Alas Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 17 h 22 m 55 sec
Reputation Power: 0
Angry My client is a Moron

Have you ever tried to explain server-side validation to a client...DONT they are morons...

After explaining that one page must go to another "action page" im still being asked to make a one page form without a submit button that knows if a person on a drop down menu chose student or teacher...this causes another part of the form to appear depending on what they chose.

I attempted making the page submit to itself making it appear as the same page only checking CFIF's to add new parts, but one still needs to click on a submit button everytime.

Is there anyway to do this without a submit button?
Ive seen some dropdown menus on sites that act as a submit...anyway to do that in coldfusion?

Reply With Quote
  #2  
Old September 15th, 2004, 02:41 AM
spicy spicy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Gold Coast, Australia
Posts: 77 spicy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 32 m 53 sec
Reputation Power: 5
Hi,

I hate this too. I know it can be done in Java script, and there may be something there in the forums, I am not too familiar with Java.

You may also be able to do this using the on blur attribute on form items, again I have never done this myself. I think the best bet is to use Java as CF is very Java compatible.

Sorry I ain't much help! I will keep an eye out as I would like to know this trick myself.

Reply With Quote
  #3  
Old September 15th, 2004, 09:10 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
You can add an onChange() event handler to the form element that submits the form. But you're still submitting the form, all you've done is stop them from having to press the submit button. The page still has to reload. And, if the user has Javascript turned off the whole form will break. Finally, anyone using a screen reader (a blind person for example) will be unable to use the app becuase every time they try to scroll through a list in a select box for example, the page will reload.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old September 15th, 2004, 10:59 AM
FALCONSEYE FALCONSEYE is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 377 FALCONSEYE Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 16 h 57 m 14 sec
Warnings Level: 15
Number of bans: 1
Reputation Power: 0
perhaps this might work.

you have a select let's say selectRole,

<select name="selRole">
<option value="0">Select a role</option>
<option value="1">Student</option>
<option value="2">Teacher</option>
</select>

then you can put all your cf code in a <cfif>
something like

<cfif IsDefined('FORM.selRole') AND #FORM.selRole# NEQ 0>
take some action
<cfelse>
display the form
</cfif>


i did use this logic couple times to have one page instead of one that takes the user input and another one that process that input. hope it helps..

Reply With Quote
  #5  
Old September 16th, 2004, 09:36 AM
wdn2000's Avatar
wdn2000 wdn2000 is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Apr 2000
Posts: 1,058 wdn2000 User rank is Sergeant (500 - 2000 Reputation Level)wdn2000 User rank is Sergeant (500 - 2000 Reputation Level)wdn2000 User rank is Sergeant (500 - 2000 Reputation Level)wdn2000 User rank is Sergeant (500 - 2000 Reputation Level)wdn2000 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 6 Days 20 h 56 m 43 sec
Reputation Power: 16
Here's an example of the JS solution mentioned above (sanitized a bit for public consumption):

Code:
<script language="JavaScript"><!--
function goto_URL(object) {
  window.location.href = object.options[object.selectedIndex].value;
}
//--></script>
<form method=post action="director.cfm" name="myForm">
  <select name="location" onChange="goto_URL(this.form.location)">
    <option value="reports_menu.cfm">Select a report</option>
    <option value="report_1.cfm">Report 1</option>
    <option value="report_2.cfm">Report 2</option>
    <option value="report_3.cfm">Report 3</option>
  </select>
  <input type="submit" value="Go">
</form>


The director.cfm script handles the redirect if the user doesn't have JS, or somehow manages to click the submit button before the JS can do it's magic. And it looks like this:

Code:
<cfif #Parameterexists(FORM.location)# IS "YES">
  <cflocation url="#FORM.location#">
<cfelse>
  <cflocation url="index.cfm">  
</cfif>


I never use JS without having a backup for users that don't have it. If you don't want to have a button just leave it out and it should work just fine for users with JS.

Reply With Quote
  #6  
Old September 18th, 2004, 09:14 PM
Alas's Avatar
Alas Alas is offline
Wickedwd.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: wickedwd.com
Posts: 186 Alas Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 17 h 22 m 55 sec
Reputation Power: 0
Thumbs up got it

Thanks for the help, but i found the dropdown that automatically submits in some software called D2 tools for ms frontpage. Its a trial, but u can buy it or work fast, whichever...anyway here it is.

http://www.download.com/3302-2048_4-10255139.html

Reply With Quote
  #7  
Old October 1st, 2004, 06:25 PM
z44sms z44sms is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 9 z44sms User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up I had same problem with Coldfusion on actions

the ONACTION, ONCLICK, ONMOUSEOVER anything like that should work in FORM but nope (HTML need UPDATE standard). I had to add java script, however it's not really a cold fusion issue it's legacy of HTML never adding new sub catagories to it ... in past CGI scripts had to be used for forms, so at least programmers got submit option nowdays that you don't have to manipulate in CGI for a simple FORM....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > My client is a Moron


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway