Jump to content

Need help if my idea can be done.....


hass87

Recommended Posts

I have  a dropdown list where the values are retrieved form the mysql

the dropdownlist is coded in php as below:

 

$data = mysql_query("Select * From Project");

echo "<select name = 'Project' onchange = 'showUser(this.value)'>n";

while ($row = mysql_fetch_assoc($data))

{

$id = $row['Project_Id'];

$ProjectName = $row['ProjectName'];

echo "<option value = $id>$ProjectName";

}

echo"</select>";

echo "<br/>";

echo "<br/><div id='txtHint' style='width:30em; margin:0 auto;'></div><br/>";

 

this dropdownlist will retrieved the names of PROJECTS available in the database.

when the user click any of the rpojects, it will displayed the engagements that belong to the selected PROJECT.

This is also retrieved and display in a dynamic table using ajax. i have created a javascript function as below:

 

<script type="text/javascript">

function showUser(str)

{

if (str=="")

  {

  document.getElementById("txtHint").innerHTML="";

  return;

  }

if (window.XMLHttpRequest)

  {// code for IE7+, Firefox, Chrome, Opera, Safari

  xmlhttp=new XMLHttpRequest();

  }

else

  {// code for IE6, IE5

  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

  }

xmlhttp.onreadystatechange=function()

  {

  if (xmlhttp.readyState==4 && xmlhttp.status==200)

    {

    document.getElementById("txtHint").innerHTML=xmlhttp.responseText;

    }

  }

xmlhttp.open("GET","try.php?q="+str,true);

xmlhttp.send();

}

</script>

function showUser is placed in the "<select name = 'Project' onchange = 'showUser(this.value)'>

my question is, is it possible that i display the data retrieved in the tables as hyperlinks?

I want the user to be able to view the informations of the displayed engagements in another php page.

the user can view the informations when they clicked on the hyperlinks of the engagement name that is displayed.

 

the sample of table can be seen in the attachment.

any idea on how to do this.

Let me know cause im stuck :shrug:

 

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/209324-need-help-if-my-idea-can-be-done/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.