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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overriding a form's input Value with CSS only

Status
Not open for further replies.

AdeleMB

Technical User
Mar 31, 2008
10
GB
Hi,
I don't even know if this is possible but I need to override the input value for a search box using only CSS.
I don't have access to the form's HTML as it is managed by a library management system but do have a CSS where I can set overrides up.

This is the form's HTML (which i cannot change):

Code:
<form method="get" action="items" id="searchform">
<div class="formElement">
<label class="hidden" for="s" id="jslabel">Search the library catalogue</label>
<input type="text" value="Search the library catalogue" maxlength="1000" name="query" onblur="if (this.value == '') {this.value = document.getElementById('jslabel').innerHTML;}" onfocus="if (this.value == document.getElementById('jslabel').innerHTML) {this.value = '';}" id="s"><input type="submit" value="Search" id="searchsubmit"><a title="Advanced Search" id="advanced-search-link" href="advancedsearch.php?query=Search+the+library+catalogue">More search options</a>
</div>
</form>
Is there any way to change all instances of text saying "Search the library catalogue" to "Enter a keyword, title, author or ISBN" using only CSS?

I could possibly do it with JavaScript but am far less confident!

Thanks so much for any help!!
Adele
 
Is there any way to change all instances of text saying "Search the library catalogue" to "Enter a keyword, title, author or ISBN" using only CSS?

While there is a remote chance you might be able to do it for IE using CSS expressions, really, the answer is "no" if you're looking to support the majority of browsers.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi Dan,
thanks for this, I had pretty much exhausted every option I know with this one!
It does need to be cross-browser compatible so will look into JavaScript instead.
Thanks again!
Adele
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top