| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Nov 2007
Posts: 30
|
Question concerning forms
Hey guys, It's been bugging me lately whenever I see forms that have rollover capabilities Thanks, Will |
|
|
|
|
|
#2 (permalink) |
|
Web Schizophrenic
Join Date: Feb 2008
Location: In your head
Posts: 34
|
It a input field with javascript function that change the value of the field when you click on the field. HTML Code:
You can make function with javascript and call it on a particular event like : onDblClick, onFocus, onMouseOver, onBlur, etc... hope you understand my poor english |
|
|
|
#3 (permalink) |
|
unusual suspect ™
Join Date: Jul 2004
Location: DE, USA
Posts: 2,900
|
To clear the default value add this to your head (or an external js): Code:
Code:
Not quite sure what you mean by the mouseover effect but if you mean the submit button then it's a real simple CSS styling. |
|
|
|
#5 (permalink) |
|
Registered User
Join Date: Nov 2007
Posts: 30
|
Both of these are Great! Thank you so much. How would I accomplish making the form's outline color change, like with a rollover. The rollover is meant by this, look at Adobe's search bar: Adobe Last edited by willpower935 : 23-02-2008 at 22:44. |
|
|
|
#8 (permalink) |
|
Registered User
Join Date: Nov 2007
Posts: 30
|
Thanks
Thank you guys so much, I finally replicated their search bar and, more importantly, I understand it! I thought I'd post the code I used for anyone else who had this same problem: "head of my HTML doc:" <script> //Clearing the search form's text function clearForm(searchForm) { if(searchForm.defaultValue == searchForm.value) { searchForm.value = ""; } } //Setting the form's text back to default function setToDefault(searchForm) { if(searchForm.value == "") { searchForm.value = searchForm.defaultValue; } } </script> "HTML body:" <input name="searchForm" type = "text" id="searchForm" onfocus = "clearForm(this)" onblur = "setToDefault(this)" value = "Search for..." maxlength="100"/> "External CSS:" #searchForm { border: 1px solid #CCCCCC; padding-left: 3px; } #searchForm:focus, #searchForm:hover { border-color: #000000; } Thank You! Last edited by willpower935 : 24-02-2008 at 16:55. |
|
![]() |