2 Replies - 563 Views - Last Post: 07 December 2012 - 12:29 PM Rate Topic: -----

#1 Bestford  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 44
  • Joined: 05-December 11

Problem: more information drop down box

Posted 07 December 2012 - 06:19 AM

hello, i want to be able to make a link that is clickable and then when the user clicks it makes a drop down box with more infomation about the chosen module what i have a the moment is two files and i don't want that:
this is in one file (selects a module) this is the page where i want the drop down information
$sql2 = "SELECT * FROM lr_module";
$query = mysql_query($sql2)
		or die(mysql_error());
while ($_row = mysql_fetch_assoc($query)) {
	$module_id = $_row['module_id'];
	$module_code = $_row['module_code'];
	$module_name = $_row['module_name'];
	echo"<div class=\"progresult\">";
	echo"<a href=\"moduleInfo.php?module_id=$module_id\"><strong>Module code:</strong> $module_code <strong>module Name:</strong> $module_name</a> <br />";


this is where it leads to on the link that the user clicks

if ((!isset($_REQUEST['module_id']))) {
	die("<p>You have to complete the form first!</p>\n");
$module_id = $_GET['module_id'];
$sql = "SELECT * FROM lr_module WHERE module_id = $module_id";
$queryresult = mysql_query($sql)
		or die(mysql_error());
while ($row = mysql_fetch_assoc($queryresult)) {
	$module_id 		= $row['module_id'];
	$module_code		= $row['module_code'];
	$module_name 		= $row['module_name'];
	$moduleTutor = full_name_from_id($row['user_id']);
	$moduleDesc 		= $row['module_desc'];
	$module_link 		= $row['module_link'];
	echo"<h2>Module Information for: $module_code</h2>";
	echo "<p>Below is the information that belongs to the Module: $module_name</p>";

	echo"Module Code: $module_code <br />";
	echo"Module Name: $module_name <br />";
	echo"Module Tutor: $moduleTutor <br />";
	echo"Module Description: $moduleDesc<br />";
	echo"Module Link: $module_link<br />";

anyone got any ideas

Is This A Good Question/Topic? 0
  • +

Replies To: Problem: more information drop down box

#2 Atli  Icon User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4238
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: Problem: more information drop down box

Posted 07 December 2012 - 06:43 AM


To create tooltip-like things when clicking a link, you will need to use Javascript. Essentially, you use Javascript to capture the click event of the link, then use that to create/show a new element, fill it with whatever info you need to show, and then move it to where the mouse is located.

You can probably also find various premade tooltip codes. There are probably loads of them available as jQuery plugins.
Was This Post Helpful? 0
  • +
  • -

#3 laytonsdad  Icon User is offline

  • Let it rip!
  • member icon

Reputation: 466
  • View blog
  • Posts: 1,991
  • Joined: 30-April 10

Re: Problem: more information drop down box

Posted 07 December 2012 - 12:29 PM

You could use Ajax to get the information from the second page an add it to the existing page.
Check out the query shortcut.post().
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1