?
Solved

Mouseover Field Fill

Posted on 2003-02-26
12
Medium Priority
?
300 Views
Last Modified: 2010-04-09
I have a form with multiple fields I want to be able to mouse over the value on a field and fill the contents of another field with a value almost like a help pop-up but in an isolated location.

fielda -  value
fieldb -  value



help: value

so mouse over label fielda and value for help would change.

Does anyone have a sample of this?
0
Comment
Question by:pinkstonm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 8026421
<INPUT type='text' name='field1' value='xyz' title='Help Text Goes Here'
   onmouseover='this.form.helptext.value=this.value;' />

<TEXTAREA name='helptext'></textarea>

0
 
LVL 33

Expert Comment

by:knightEknight
ID: 8026427
I used value becuase you requested it ... you could also use the title like this:

onmouseover='this.form.helptext.value=this.title;'
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 8026435
oh ... I missed one thing ... you said "mouse over LABEL" ... in that case you would have to make an anchor or div out of the label:

<FORM>
<div onmouseover='document.forms[0].helptext.value=document.forms[0].field1.title;'>Label 1</div>
<INPUT type='text' name='field1' value='xyz' title='Help Text Goes Here'
  onmouseover='this.form.helptext.value=this.value;' />

<TEXTAREA name='helptext'></textarea>

</form>
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Expert Comment

by:knightEknight
ID: 8026449
arg ... now I've got two mouseover events ... let me clean it up:


<FORM>

<DIV onmouseover='document.forms[0].helptext.value=document.forms[0].field1.title;'>Label 1</div>

<INPUT type='text' name='field1' value='xyz' title='Help Text Goes Here' />

<DIV onmouseover='document.forms[0].helptext.value=document.forms[0].field2.title;'>Label 1</div>

<INPUT type='text' name='field2' value='pdq' title='Help Text Goes Here' />

<TEXTAREA name='helptext'></textarea>

</form>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 8026453
ARG!  Now I've got two Label 1's!  I'm sure you can handle that yourself :)
0
 
LVL 2

Accepted Solution

by:
weeezl earned 400 total points
ID: 8027196
This may not be exactly what you're looking for, but I find this format to be very nice for help tips.

http://webfx.eae.net/dhtml/helptip/helptip.html

But if you just want the help to show up in a certain area...

<script>
function fillHelp (help) {
var helpOutput=document.getElementById("output");
helpOutput.innerText=help;
}
</script>

Input 1:<input type=text onmouseover="fillHelp('This is the help for Input 1')">
<br>
Input 2:<input type=text onmouseover="fillHelp('Input 2 help goes here')">
<br><br>
Help: <span id=output></span>
0
 

Author Comment

by:pinkstonm
ID: 8027247
This does not handle Mouseout tho???
0
 

Author Comment

by:pinkstonm
ID: 8027287
This does not handle Mouseout tho???
0
 
LVL 2

Expert Comment

by:weeezl
ID: 8027360
ok... Add a mouseout.

<script>
function fillHelp (help) {
var helpOutput=document.getElementById("output");
if (help==null)
help='';
helpOutput.innerText=help;
}
</script>

Input 1:<input type=text onmouseover="fillHelp('This is the help for Input 1')" onmouseout="fillHelp()">
<br>
Input 2:<input type=text onmouseover="fillHelp('Input 2 help goes here')" onmouseout="fillHelp()">
<br><br>
Help: <span id=output></span>
0
 

Author Comment

by:pinkstonm
ID: 8027485
WEEEZ, Perfect exactly what I was looking for....
0
 

Author Comment

by:pinkstonm
ID: 8029563
Hey Weeez could you hint me on how to get that field to say something before I mouse on the initial entry?
0
 
LVL 2

Expert Comment

by:weeezl
ID: 8029599
Just put an initial value in HTML inside of the span. Any new value added through the function will clear it.

Input 1:<input type=text onmouseover="fillHelp('This is the help for Input 1')" onmouseout="fillHelp()">
<br>
Input 2:<input type=text onmouseover="fillHelp('Input 2 help goes here')" onmouseout="fillHelp()">
<br><br>
Help: <span id=output>Initial Help Value</span>
0

Featured Post

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question