No I didn't try and I'm using FF3 so it should have worked.
How would I rewrite it so it'd work for all browsers?
Main Topics
Browse All TopicsGot the following javascript in one of my pages to update the label for a textarea when a user selects a particular
option from a select. how do I make the label change and it be reflected in the page?
function output()
{
var usage;
qs_enginename = document.getElementById('q
if (qs_enginename == 'siteauthor')
{
usage = "Usage: keyword(s) author:username";
} else {
usage = "Usage: keyword(s)";
};
document.getElementById("u
// The alert box correctly shows the innerText I want but
// the Label DOES NOT CHANGE
alert(document.getElementB
}
HTML:
<form id="qsearch_form" method="post" action="search.php" onsubmit="return qsearch_onSubmit();">
<p>
<input type="text" tabindex="6" name="keywords" id="searchfield" size="22" maxlength="40" title="searchkw" value="" />
</p>
<p>
<select id="qsearch_select" tabindex="7" onChange="output()">
<optgroup label="SITE">
<option value="site">Posts</option
<option value="siteauthor">Posts by Author</option>
<option value="author">Author</opt
</optgroup>
<optgroup label="ENGINE">
<option value="wikipedia">Wikipedi
<option value="google">Google</opt
<option value="yahoo">Yahoo</optio
<option value="msnlive">MSNlive</o
<option value="altavista">Altavist
<option value="lycos">Lycos</optio
<option value="odp">Open directory</option>
</optgroup>
</select>
<input type="hidden" name="search_fields" value="all" />
<input type="hidden" name="show_results" value="topics" />
<input type="submit" value="sh" class="button2" tabindex="8" />
</p>
<label for="searchfield" id="usage">Usage: keyword(s)</label>
<br />
</form>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
.innerHTML works.
.innerText does not work in firefox according to this:
http://blog.coderlab.us/20
.textContent works in Firefox.
According to this, something similar is needed for safari
http://blog.coderlab.us/20
FYI .innerHTML works for all of them, but of course it can have an effect different than you want if html markup is in the text.
Business Accounts
Answer for Membership
by: kevin_uPosted on 2009-07-18 at 14:45:16ID: 24887454
It should not requre any refreshing.
search_sel ect').valu e
search_sel ect'); x.selected Index].val ue
It may not working because this line may not be supported in your browser:
qs_enginename = document.getElementById('q
var selectBox = document.getElementById('q
qs_enginename = selectBox.options[selectBo
You may also try innerHTML instead of innerText