| | |
how to show a larger input field with mouseover?
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2009
Posts: 35
Reputation:
Solved Threads: 0
I'm showing in a field the name of the file the user has chosen. I would like to show the whole name as the title when passing the mouse over the field, in case the name is too long.
I swear this was working, but it's not anymore (I'm testing with FF). I don't know how it was working, maybe I used a different combination of quotes or semicolons or I don't know. I can't make it work again. When you pass de mouse over the field it is showing the code instead of the innerHTML referenced:
demo:
http://www.lloparts.com/america/editora/testTitle.html
I swear this was working, but it's not anymore (I'm testing with FF). I don't know how it was working, maybe I used a different combination of quotes or semicolons or I don't know. I can't make it work again. When you pass de mouse over the field it is showing the code instead of the innerHTML referenced:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es"> <head> <script type="text/javascript"> function newField() { document.getElementById('container').innerHTML = '<div id="myFile" style="width:100px;overflow:hidden;border:thin solid" title="document.getElementById(\'myFile\').innerHTML">thisisaverylongfilename.jpg</div>'; } </script> </head> <body onload="newField()"> <div id="container" /> </body> </html>
demo:
http://www.lloparts.com/america/editora/testTitle.html
Last edited by Altairzq; 27 Days Ago at 8:06 pm.
•
•
Join Date: Dec 2008
Posts: 106
Reputation:
Solved Threads: 15
0
#2 27 Days Ago
Change your function as shown below
You may use document.getElementById('myFile').innerText
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
function newField() { document.getElementById('container').innerHTML = '<div id="myFile" style="width:100px;overflow:hidden;border:thin solid" title=\'' + document.getElementById('myFile').innerHTML+ '\'>thisisaverylongfilename.jpg</div>'; }
•
•
Join Date: Aug 2009
Posts: 35
Reputation:
Solved Threads: 0
0
#4 26 Days Ago
It's not working either, it gives an error because the field "myFile" doesn't exist yet.
It was working when I created the field from PHP-Ajax, could that be it? But if there wasn't Javascript involved how could it interpret the code?
This is the piece of code I used, more or less. This one is not working:
It was working when I created the field from PHP-Ajax, could that be it? But if there wasn't Javascript involved how could it interpret the code?

This is the piece of code I used, more or less. This one is not working:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<tr> <td /> <td colspan='3' style=\"padding-bottom:4px\"> <div id='escollitOriPri' style=\"height:14px;text-align:center;font-size:11px;overflow:hidden;cursor:default\" title=\"document.getElementById('escollitOriPri').innerHTML\"> </div> </td> </tr>
Last edited by Altairzq; 26 Days Ago at 1:02 pm.
•
•
Join Date: May 2009
Posts: 372
Reputation:
Solved Threads: 26
0
#5 26 Days Ago
This is my interpretation, as to how it "used" to be done but new coding might be different to what I've learnt.
colspane = 3 A number is not enclosed in quotes as it is a number and not text.
I do not know the reference of backslash for the style tags.
The only thing is if the title tag within the div tag is supposed to be there or in its own enclosures.
I'd be interested to see if my modifications work within your sheet.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<tr><td colspan=3 style=padding-bottom:4px> <div id="escollitOriPri" style="height:14px;text-align:center;font-size:11px;overflow:hidden;cursor:default; title=document.getElementById('escollitOriPri').innerHTML"></div></td></tr>
colspane = 3 A number is not enclosed in quotes as it is a number and not text.
I do not know the reference of backslash for the style tags.
The only thing is if the title tag within the div tag is supposed to be there or in its own enclosures.
I'd be interested to see if my modifications work within your sheet.
Last edited by Jupiter 2; 26 Days Ago at 1:50 pm. Reason: Quote marks
If ALL my answers are wrong, only then will I read the question
1
#6 26 Days Ago
•
•
•
•
colspane = 3 A number is not enclosed in quotes as it is a number and not text.
<button disabled>test</button> is also not legal using XHTML, you have to set <button disabled="disabled">test</button> if I recall correctly.Also, in old HTML you had the OPTION of leaving off quotes at simple input. But it's nothing to worry about actually 'cause all normal browsers don't care anyway :-), but if you want to follow the new standards, always use quotes, and always close every tag (even br:
<br /> . •
•
Join Date: May 2009
Posts: 372
Reputation:
Solved Threads: 26
0
#7 26 Days Ago
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<br />
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<BR>
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<P>
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
</P>
Last edited by Jupiter 2; 26 Days Ago at 1:48 am. Reason: typas
If ALL my answers are wrong, only then will I read the question
0
#8 26 Days Ago
It's not an end break tag (the / is at the end of the tag). Whenever (in XHTML as said) you have empty tags (like br, hr, img and meta) you should close them using the shorthand-syntax.
Therefore you have
And one more thing, all tagnames and attributes should be lowercase.
<p id="a1"></p> is in theory equivalent to <p id="a1" /> . Problem is that tags that aren't normaly empty by some reason isn't read as XHTML (this might be because XHTML requires the browser to fail if it finds errors in the markup if I'm not mistaken). But always-empty tags do require this syntax.Therefore you have
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<br /> <hr /> <img href="..." /> etc.
And one more thing, all tagnames and attributes should be lowercase.
•
•
Join Date: May 2009
Posts: 372
Reputation:
Solved Threads: 26
0
#10 26 Days Ago
I looked up XHTML and the closing bracket is correct. I'm an old hack from way back and just used to old HTML code.
In Post #4, the 2nd line refers to a closing td but no open td? Maybe somewhere above that you did not inlcude?
I"m new to this so I'm only making suggestions. I'm a bit out of my depth with xhtml. I still use HTML hard code by hand so xhtml is not part of my repertoire.
This is my last post on this subject.
In Post #4, the 2nd line refers to a closing td but no open td? Maybe somewhere above that you did not inlcude?
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<tr> <td /> [\CODE] [CODE} <td colspan='3' style=\"padding-bottom:4px\"> style= \"padding .... Shouldn't the Quote marks start before the backslash?
I"m new to this so I'm only making suggestions. I'm a bit out of my depth with xhtml. I still use HTML hard code by hand so xhtml is not part of my repertoire.
This is my last post on this subject.
If ALL my answers are wrong, only then will I read the question
![]() |
Similar Threads
- How to get full path from a file input field (JavaScript / DHTML / AJAX)
- Send data of card number with four input field to mysql (PHP)
- How can show/view Infopath dynamic files(xml) without infopath in a computer (XML, XSLT and XPATH)
- AJAX created input field does not work in FireFox (JavaScript / DHTML / AJAX)
- HTML input text size (JavaScript / DHTML / AJAX)
- Using a popup to fill an input field (JavaScript / DHTML / AJAX)
- how to get to next record on click of a button. (JavaScript / DHTML / AJAX)
- help Creating "input-fields" (Visual Basic 4 / 5 / 6)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Regex to remove 'Illegal Characters'
- Next Thread: List Items
| Thread Tools | Search this Thread |
ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically browser bug calendar captchaformproblem checkbox child class close cookies createrange() cursor date debugger dependent disablefirebug dom dropdown editor element embed engine events explorer ext file form forms getselection google gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe image() images internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jump libcurl maps math media microsoft object onerror onmouseoutdivproblem onreadystatechange parent paypal pdf php player position post programming progressbar rated regex runtime safari scriptlets scroll search security session shopping size software sql star stars synchronous text textarea unicode validation web webservice website windowsxp wysiwyg \n





