i want to loop the form, so that there would be a multiple select boxes.. the first loop of select box has still its value, but the remaining loops has an empty value for select box..

[IMG]http://i5.photobucket.com/albums/y174/dikoalam/example.png[/IMG]

here is the code..

<form action="" method="post" name="formx">
	<select name='eecollege2' id='college' onChange="selected(this.selectedIndex)">
		echo "<option value='0' selected>select</option>
		<option value='Engineering'>Engineering</option>
		<option value='Business Administration'>Business Administration</option>
		<option value='Arts and Science'>Arts and Science</option>
		<option value='Fine Arts'>Fine Arts</option></select>
			<td><select name='eecourse2' id='course'>
		<option value='0' selected>select</option></select></form>
		
		<script language="javascript">

    var colleges=document.formx.college
    var courses1=document.formx.course
    
    var course=new Array()
    course[0]=['Select course..']    
    course[1]=['CE','COE','EE','ECE','IE','ME','CS','IS','IT']    
    course[2]=['BSA-CAS','BSA','BSBA-FM','BSBA-BEC','BSBA-MGE','BSBA-MKM','BSBA-MA','BSENT']    
    course[3]=['AB-Comm Arts','Tourism','HRM', 'Sec. Mgt.']
	course[4]=['BFA','BFA-Int Design','BFA-Painting','BID']
    
    function selected(collgrp){                
        courses1.options.length=0                    
        if(collgrp >= 0){                    
            for(i=0; i<course[collgrp].length; i++)

            courses1.options[courses1.options.length]=new Option(course[collgrp][i], course[collgrp][i])
        }
    }
    
</script>

help me please... :(

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.