Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show help text next to item

Status
Not open for further replies.

rmagan

Programmer
Jun 3, 2003
35
US
I have a table of text items. When a user enters the field, I would like to display some bubble help next to the appropriate text item. When they leave he field, the help must disappear. Any suggestions?

<TD>
<input type=&quot;text&quot; name=&quot;p_grd_score&quot; size=&quot;5&quot; maxlength=&quot;5&quot; value=&quot;hello&quot;>
</TD>
<TD>
<input type=&quot;text&quot; name=&quot;p_grd_score2&quot; size=&quot;5&quot; maxlength=&quot;5&quot; value=&quot;hello2&quot;>
</TD>

 
rmagan,

What you're looking for it aften called a tool tip. Try this:

[tt]<INPUT TYPE=&quot;text&quot; NAME=&quot;yourName&quot; TITLE=&quot;Enter your name here...&quot; SIZE=&quot;30&quot;>[/tt]

When the user rolls the mouse pointer over the input box, the tool tip will be displayed.

Works fine in IE -don't know if it's cross browser compatible...!?!

Good Luck §;O)


Jakob
 
I was also directed to this site:

All the examples posted on that site are for mouseover and mouseout examples, but I'm sure you could probably apply it to focus and blur methods as well. The tutorials are pretty descriptive and you have a lot of flexibility on how your popups display. Very nice tool.

-kaht

banghead.gif
 
Hi all,

You can also achieve what you are after by the following code:

Code:
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script language=&quot;javascript&quot;>

function DisplayHelp(Params){
		  if (document.getElementById(Params).style.display == &quot;&quot;) {
		    document.getElementById(Params).style.display = &quot;none&quot;;		   
		  } else {
		    document.getElementById(Params).style.display = &quot;&quot;;		    
		  }
}

function RemoveHelp(Params){
		  
		    document.getElementById(Params).style.display = &quot;none&quot;;		    
		  
}

</script>
</HEAD>

<BODY>
<table border=&quot;0&quot;>
	<tr>
		<td>
			<input type=&quot;text&quot; name=&quot;myText1&quot; onFocus=&quot;DisplayHelp('text1')&quot; onBlur=&quot;RemoveHelp('text1')&quot;>
		</td>
		<td>
			<div align=&quot;left&quot; id=&quot;text1&quot; style=&quot;display:none&quot;>Help text 1</div>
		</td>
	<tr>
	<tr>
		<td>
			<input type=&quot;text&quot; name=&quot;myText2&quot; onFocus=&quot;DisplayHelp('text2')&quot; onBlur=&quot;RemoveHelp('text2')&quot;>
		</td>
		<td>
			<div align=&quot;left&quot; id=&quot;text2&quot; style=&quot;display:none&quot;>Help text 2</div>
		</td>
	<tr>
	<tr>
		<td>
			<input type=&quot;text&quot; name=&quot;myText3&quot; onFocus=&quot;DisplayHelp('text3')&quot; onBlur=&quot;RemoveHelp('text3')&quot;>
		</td>
		<td>
			<div align=&quot;left&quot; id=&quot;text3&quot; style=&quot;display:none&quot;>Help text 3</div>
		</td>
	<tr>
</table>
</BODY>
</HTML>

You can make the help text display wherever you want by just placing the
Code:
<div align=&quot;left&quot; id=&quot;text3&quot; style=&quot;display:none&quot;>Help text 3</div>
wherever you want to.

Have fun,

Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top