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:
  #1  
Old February 19th, 2005, 09:50 AM
midimidi midimidi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 83 midimidi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 29 m
Reputation Power: 4
javascript:onChange and cfforms

Is there a way to automatically submit a cfform when an element changes?

I'm currently trying onChange="javascript:document.form.submit();" within a select tag, with no success. In IE6 it returns with a javascript error:

"Object doesn't support this property or method"

I've also tried creating a custom javascript function but I get the same error (note - form works fine when using the Submit button):

Code:
<cfoutput>
<cfform action="samepage.cfm" method="POST" name="form">
  <select name="formelement" onChange="customsubmit();">
    <option value="somevalue">somelist</option>
  </select>
<input type="submit" name="submit">
</cfform>
</cfoutput>

<script language="JavaScript" type="text/javascript">
<!--
function customsubmit()
{
document.form.submit();
}
// -->
</script>

Reply With Quote
  #2  
Old February 21st, 2005, 02:57 PM
VelvettFogg VelvettFogg is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 34 VelvettFogg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 13 m 46 sec
Reputation Power: 4
How about some javascript that clicks the submit button?

Reply With Quote
  #3  
Old February 21st, 2005, 06:04 PM
Panther893's Avatar
Panther893 Panther893 is offline
MostarDesigns.com
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2004
Posts: 820 Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level)Panther893 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 5 Days 21 h 11 m 17 sec
Reputation Power: 56
Send a message via MSN to Panther893
how about this, just try using this in ur onchange tag and no javascript

onChange="javascript:selectNav(this,'somepage.cfm');"

Reply With Quote
  #4  
Old February 22nd, 2005, 09:00 AM
Bastion Bastion is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 181 Bastion User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 4 h 23 m 47 sec
Reputation Power: 4
If you can rule out Cold Fusion as the issue. I suggest taking a look at the javascript. I don't recommend naming a form "form" It's bad code because "form" is already used in javascript as an array or whatever. Change the name to something not taken.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > onChange and cfforms


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 4 hosted by Hostway