|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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>
|
|
#2
|
|||
|
|||
|
How about some javascript that clicks the submit button?
|
|
#3
|
||||
|
||||
|
how about this, just try using this in ur onchange tag and no javascript
onChange="javascript:selectNav(this,'somepage.cfm');" |
|
#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.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > onChange and cfforms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|