kjreif
08-07-2008, 08:43 PM
I'm new to JavaScript and I'm trying to alter this script (that I got from here) a little bit, and I'm wondering if anyone could help me out. The script works great by taking the value from the option tag and changing the image. My problem is that, I need the value to be not the entire image path, but rather just a letter because the form also links up to my sql database where I need the data from that inserted. So for example instead of having the value="images/a.jpg" I would need it to be value="a" so that "a" gets inserted into the database instead of the whole path. Is there a way to alter the return value so it has the path then the value then the extension? For example path/VALUE/.jpg (where path and value are always the same).
I hope this makes sense - and thanks in advance for your help!
Kelly
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
I hope this makes sense - and thanks in advance for your help!
Kelly
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}