Click to See Complete Forum and Search --> : Need Help Editing the Script!


sharapov
04-15-2003, 01:50 PM
I have this script that takes values from the input text fields and displays them on a new page in the table. In one of the hidden fields I have a value of 123456.jpg (for example). What I want to do is display the actual image in the new generated table and not the value of the field. In other words I need to convert 123456.jpg into <img src="1234565.jpg"> so it would show an image. Can anybody help? To look at the actual script go here: http://home.pacbell.net/sharapov/example2.htm

khalidali63
04-15-2003, 02:24 PM
as you mentioned you already have value in the hidden field.what you need to do to creae an image is this.
put an id attribute in table or in the cell where you potentially want to put the image

then onload event of the body

document.getElementById("divID").innerHTML="<img src=\""+document.formName.hiddenFieldName.value+"\">";
this will print the image in a particular cell....etc..

Cheers

Khalid

sharapov
04-15-2003, 02:35 PM
khalidali63,

Thank you for your reply. I can't assign ids to the cells or table because original data is generated from the database. Look how the script works (without image part) here: http://home.pacbell.net/sharapov/example2.htm

Thanks.

khalidali63
04-15-2003, 03:00 PM
I guess you do have some control on the parent page where preview buton is?
if so then in this page
where you create the whole table,just pick a point and in the <td> tag add this line

<img src=\""+document.formName.hiddenFieldName.value+"\">";

it should create image there

????

Khalid