Page 1 of 1

changing the text displayed when a item in a listbox

Posted: Sat Jul 26, 2003 11:53 am
by psychotomus
is clicked. anyone know how to do this in java?

Posted: Sat Jul 26, 2003 1:58 pm
by Fredix
are you sure about Java??? Maybe you mean JavaScript (JS) that IS a BIG diffrence.

Posted: Sat Jul 26, 2003 3:09 pm
by psychotomus
yeah javascript

Posted: Sat Jul 26, 2003 3:13 pm
by psychotomus
also i allready have a script that changes the image

Code: Select all

<script language="javascript">


function showimage()
&#123;
if (!document.images)
return
document.images.pictures.src=
document.register.char.options&#1111;document.register.char.selectedIndex].value
&#125;
</script>
the value is something .jpg

is there away to have the value be yada then do something like

Code: Select all

<script language="javascript">


function showimage()
&#123;
if (!document.images)
return
document.images.pictures.src=
image = options&#1111;document.register.char.selectedIndex].value + ".jpg"
document.register.char.image
&#125;
</script>
where the value's of the listbox isnt filename.jpg
but instead just filename
then once it activates the script. it add .jpg
cause once i send the form, i really dont want to use string manipulation on the filename.jpg since i allready have it written to be filename