4 Replies - 1807 Views - Last Post: 30 May 2006 - 05:54 AM

#1 crescent  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-December 05

drop down issue

Posted 29 May 2006 - 09:16 PM

I am working a school related project and have created a form from where a student can choose a course from drop down and when he choose a course then two drop down will be activate one for credit and another for day/time.

Everything in one form and information will come from mysql database.


Anybody tell me plz the logic and code templete.

plz help me
Is This A Good Question/Topic? 0
  • +

Replies To: drop down issue

#2 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 84
  • View blog
  • Posts: 3,564
  • Joined: 31-March 03

Re: drop down issue

Posted 29 May 2006 - 10:02 PM

Are you wanting help in getting the course info from a database and outputting a form? Or are you wanting help in how to accomplish the form in HTML/Javascript?
Was This Post Helpful? 0
  • +
  • -

#3 crescent  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-December 05

Re: drop down issue

Posted 29 May 2006 - 11:02 PM

Here is my code. to select course another drop down will day/time apper....
Any idea



//select quiry for main drop down

function setCrList()
 {
  $quer2=mysql_query("SELECT DISTINCT coursec,courseId,coursecr FROM course_info order by coursec"); 
		while($noticia1 = mysql_fetch_array($quer2)) 
	{ 
	  echo "<option value='$noticia1[coursecr]#$noticia1[coursec]'>$noticia1[coursec]</option>"."<BR>";
	}
 }



<script language="javascript">
function setCredit(txtobj,txt)
{
var mystr=new String(txt);
var arrStr;
arrStr=mystr.split("#");
txtobj.value=arrStr[0];
}
</script>


<select name='cc[]' id="cc[]" onchange="setCredit(cr0,this.value)">
	 <option value=''>Select one</option>
<?php
setCrList();
?>
		</select>



Was This Post Helpful? 0
  • +
  • -

#4 crescent  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-December 05

Re: drop down issue

Posted 30 May 2006 - 12:20 AM

When a student select course from first drop down then credit from second drop down appear onchange='set credit()' but day/time from third drop down doesent appear...any idea????
Was This Post Helpful? 0
  • +
  • -

#5 snoj  Icon User is offline

  • Married Life
  • member icon

Reputation: 84
  • View blog
  • Posts: 3,564
  • Joined: 31-March 03

Re: drop down issue

Posted 30 May 2006 - 05:54 AM

This is a HTML/javascript question. Moving topic.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1