[thelist] Trouble submitting form using javascript

Daniel Kessler danielk at umd.edu
Mon Nov 19 09:11:24 CST 2007


I have a form that I can use the 'submit' button to submit, but am  
having trouble using javascript to submit.  I'm going to include the  
extra js function just in case it's affecting the function I'm trying  
to use.  It gives the error, "Error: document. getSel.submit is not a  
function ".

Form:
<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>



-- 

Daniel Kessler

University of Maryland College Park
School of Public Health
3302E HHP Building
College Park, MD  20742-2611
Phone: 301-405-2545
http://sph.umd.edu






More information about the thelist mailing list