[thelist] Trouble submitting form using javascript
Mark Howells-Mead
webdev at mountain.ch
Mon Nov 19 09:20:22 CST 2007
<FORM NAME="getSel" id="getSel" METHOD="POST"
action="additem_supervisor_approval.cfm" onsubmit="return
approve_individual (this)">
<script language="javascript">
function approve_individual(theform){
theform.id.value = the_id;
theform.action = 'timesheet.cfm';
theform.submit();
return false;
}
</script>
Can't comment on your function selectAll, as I can't see how you're
going to call it.
Mark Howells-Mead
- www.permanenttourist.ch
- www.flickr.com/photos/mhowells/
On 19.11.2007, at 16:11, Daniel Kessler wrote:
> <FORM NAME="getSel" id="getSel" METHOD="POST"
> action="additem_supervisor_approval.cfm">
>
> <script language="javascript">
>
> function approve_individual(id){
> var the_id = id;
> /**/
> document.getSel.id.value = the_id;
> document.getSel.action = 'timesheet.cfm'; // I've also tried
> putting in a full url here.
> alert('document.getSel.id.value:'+document.getSel.id.value);
> // displays id fine
> alert('document.getSel.action:'+document.getSel.action);
> // displays new action fine
>
> document.getSel.submit();
> // Error: document. getSel.submit is not a function
>
> }
>
> function selectAll(end_num){
> var the_end_num = end_num;
>
> for(cc=1;cc<=Number(the_end_num);cc++){
> document.getSel["approval"+cc].checked = 'checked';
> }
>
> }
> </script>
>
More information about the thelist
mailing list