Hi,
I need some help to override the input value for a search box using only JavaScript.
I originally wanted to do this with CSS but a kind techie in the CSS forum here told me that it wasn't really possible while remaining cross-browser compatible.
I don't have access to the form's HTML as it is managed by a library management system but I can attach separate Javascript documents.
This is the form's HTML (which i cannot change):
Is there any way to change all instances of "Search the library catalogue" to "Enter a keyword, title, author or ISBN" using JavaScript?
Thanks so much for any help!!
Adele
I need some help to override the input value for a search box using only JavaScript.
I originally wanted to do this with CSS but a kind techie in the CSS forum here told me that it wasn't really possible while remaining cross-browser compatible.
I don't have access to the form's HTML as it is managed by a library management system but I can attach separate Javascript documents.
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 "Search the library catalogue" to "Enter a keyword, title, author or ISBN" using JavaScript?
Thanks so much for any help!!
Adele