473,395 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

popup hints/information?

118 100+
my website

In my website, (only working on basic structure so far, only just started) there is a text box for the user to enter a search Criteria or URL to search either Wikipedia or Google, or to go to the URL they inputted. There are 3 buttons - 'Search Wikipedia', 'Search Google' and 'Go!'.

I was thinking people might get confused so I intended to add an instruction on either onMouseOver or onFocus, which reads:

"To search Wikipedia or Google - enter your search criteria and click the corresponding button. If you wish to go to a URL: enter your criteria and Press 'Go!' "

How, using Javascript, would I get the message/instruction to appear, in say, a box hovering underneath the textbox?

Hope that made sense,

Sam
Oct 17 '07 #1
11 1801
acoder
16,027 Expert Mod 8TB
Do you want a floating box (like a tooltip) or just something which appears underneath the box as part of the page?

Create a div and set its top position to be the top of text box + the height of the text box and its left position the same as the text box. Hide it by setting the visibility property as "hidden". Show the box by setting the style.visibility property to "visible".
Oct 17 '07 #2
helraizer1
118 100+
Do you want a floating box (like a tooltip) or just something which appears underneath the box as part of the page?

Create a div and set its top position to be the top of text box + the height of the text box and its left position the same as the text box. Hide it by setting the visibility property as "hidden". Show the box by setting the style.visibility property to "visible".
I tried that with a div, it only hid the text in the div; the div itself (outline of) remained throughout. Should that be the case?

How would I do it as a floating box? The div visibility way?

Sam
Oct 17 '07 #3
acoder
16,027 Expert Mod 8TB
Set the position to be "absolute" if you don't want it to be a fixed part of the page.

Show the code that you tried.
Oct 18 '07 #4
helraizer1
118 100+
Set the position to be "absolute" if you don't want it to be a fixed part of the page.

Show the code that you tried.
Expand|Select|Wrap|Line Numbers
  1. <div id="hint" style="color:#000000; background-color:#efefef; visibility:hidden;"></div>
^(admittedly I did forget to put the positioning in).

Expand|Select|Wrap|Line Numbers
  1. function show() {
  2.  
  3. document.getElementById('hint').style.visibility = "visible";
  4. }
  5.  
  6. function clearhint() {
  7.  
  8. document.getElementById('hint').style.visibility = "hidden";
  9. }
  10.  
Then to launch the code (code for the text box)
Expand|Select|Wrap|Line Numbers
  1. <input type="text" id="myTextBox" maxlength="50" size="35" value="" onMouseOver="show()" onMouseOut="clearhint()">
Oct 18 '07 #5
acoder
16,027 Expert Mod 8TB
Have you set the left and top values?
Oct 18 '07 #6
helraizer1
118 100+
Have done now. =) It works.
Oct 18 '07 #7
acoder
16,027 Expert Mod 8TB
Good! Glad to see that you got it working.
Oct 19 '07 #8
bnashenas1984
258 100+
Hi there
Does anyone know how to show a table or what ever (like a little text) on mouse position..
I mean I need to show a little popup where the mouse pointer is when the mouse is over an object like a link (Like a tooltip)
Oct 28 '07 #9
acoder
16,027 Expert Mod 8TB
Use the information in this link to get the mouse position.

If you want, you could search for "javascript tooltip" and get a ready-made solution instead.
Oct 29 '07 #10
bnashenas1984
258 100+
thanks
its working now
Oct 29 '07 #11
acoder
16,027 Expert Mod 8TB
I'm glad you got it working.
Oct 30 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Peter Otten | last post by:
How can I close a popup menu in Tkinter by clicking elsewhere on the toplevel window underneath? I tried popup.grab_set() but this causes the popup to close immediately. An alternative would...
4
by: David Graham | last post by:
Hi I use an OnLoad event in the body tag to open a popup window. I would like to know how to go about only allowing the window to popup once i.e on subsequent visits to the parent page, the popup...
12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
3
by: Jeppe bob Dyrby | last post by:
I have a page that automaticly opens a small popup window, but it is only supposed to open this window once. A little info: function openwindow(name_var) { if (!name_var) { name_var =...
3
by: Uwe Range | last post by:
Hi to all, I am displaying a list of records in a subform which is embedded in a popup main form (in order to ensure that users close the form when leaving it). It seems to be impossible to...
1
by: Jennyfer J Barco | last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture, every time I click on the link "Picture" my program opens a popup window showing a picture of the item the selected and...
2
by: Kiyomi | last post by:
Hello, I have some codes under event ButtonSend_Click to check the user input values. This check is complicated enough using different stored procedures. Then according the result of the...
2
by: skim1114 | last post by:
I have this code in my popup window, which works perfectly except that I need it to display a new title for every image. Here the popup window code: <HTML> <HEAD> <TITLE>DETAIL</TITLE>...
11
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. ...
0
by: furqanms | last post by:
I have a little problem in a XAML application. When I use a popup in a WPF application, I am not able to get rid of the popup from the view even if I do Alt-Tab to move focus to other applications....
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.