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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.