Forum Moderators: open
Thanks,
If it is just browser text on the screen, not a value of a form element, it will be tricky.
I would do it with CSS by creating an ID in the <td> that holds the raw text. Create an alternate one as well and make that hidden. Then, on the Change of the form element, run a javascript which chooses which ID to make visible on the screen.
<select id="selector">
<option>first choice</option>
<option>second choice</option>
<option>third choice</option>
</select>
And you want to change "first choice" to "Numero Uno", this should work.
document.getElementById('selector')[0].text="Numero Uno"
It requires that the browser implements the DOM. Older and/or non-compliant browsers need slightly different code.
<select onchange="update(this[selectedIndex].text)">
<option>microseconds</option>
<option>eons</option>
<option>epochs</option>
</select>
<input id="textbox" value="microseconds">
then your javascript might be...
function update(str1) {
document.getElementById('textbox').value = str1
} Again, this may not work on older browsers and browsers that don't support the DOM.
<select>
<option value="1">Activity #1</option>
<option value="2">Activity #2</option>
etc...
</select>
There is an input field next to it where the user has to enter an amount, the unit of the amount changes depending on what you select ( i.e. - X amount of cars, X amount of bikes) This is for activity tracking and can be done by hours or by different items depending on the activity.
So, to avoid confusion, right next to the amount input box, I thought to have in plain text in a <p></p> next to it the "units"
So it would look like this:
SELECT BOX INPUT BOX <p>units</p>
The units is what changes.
I think that kind of makes sense. I am not sure if it can be done though.
Thanks again for the help.