CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 JS SetOpener() with images?

Print topic Send  topic

Author Message
Suntower

Posts: 225
Posted: 03/19/2008, 2:07 PM

Hi,

I've been using javascript to change the values of various fields in a form when a user clicks a 'Lookup' link. In the example below, the user clicks a link to select a Product ID which spawns a child window with a list of selections. The user clicks on the selection and various 'fields' in the form are updated and the child window closes. Works fine for all fields EXCEPT images.

If I include an image as one of the fields 'passed back' to the referer window, two things happen:
1. The child window does not close.
2. The image is not displayed in the referer window.

What am I doing wrong?
...at the top of the 'child' window (where Products are selected)

<script language="JavaScript" type="text/javascript">
function SetOpenerValue(currentObj,formnum,descript,uofm,price,filnam)
{
var IE = (document.all) ? 1 : 0;
if(IE) {
var SHID = currentObj.innerText;
} else {
var SHID = currentObj.text;
}

window.opener.document.SPECS.PRODUCTID.value = SHID;
window.opener.document.SPECS.FORMNUMBER.value = formnum;
// confirm(filnam);
window.opener.document.SPECS.DESCRIPTION1.value = descript;
window.opener.document.SPECS.PRODUCTS_SELLUOFM.value = uofm;
window.opener.document.SPECS.PRODUCTS_UNITPRICE.value = price;
window.opener.document.SPECS.IMAGELINK1.src = filnam;
window.opener.focus();
window.close();
}
</script>

...a row from the child window...
<td><a href="{PRODUCTID_Src}" title="Click here to select this Product" onclick="SetOpenerValue(this,'{FORMNUMBER}','{DESCRIPTION1}','{RELEASEUOFM}','{UNITPRICE}','{ImageLink1_Src}');return false;">{PRODUCTID}</a>{ProductIDLabel}</td>

Note the 'confirm' statement above which tells me that the correct value is being sent back to the parent (referer) window.

Is this technique not supported with images? Is there a workaround?

THANKS!

---JC
_________________
---On a campaign for more examples and better docs!
View profile  Send private message
Suntower

Posts: 225
Posted: 03/19/2008, 2:32 PM

Never mind...

JS is cAsE sENsitive.

ASP is not.

Arggg... Frustration. Aggravation. Got to try and maintaiiiinnnn., Controooollll................

GRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR!

:-D

---JC
_________________
---On a campaign for more examples and better docs!
View profile  Send private message
quasimidi


Posts: 151
Posted: 03/19/2008, 2:57 PM

LOL, glad you found it :D
_________________
RS
View profile  Send private message
Suntower

Posts: 225
Posted: 03/19/2008, 3:45 PM

I gotta maintain a sense of humour with this stuff otherwise I go

Neeen oodls=effos
wswerfkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk ARF!

I am an old guy and not used to 'mash-up' programming---mixing JS, ASP, Python, C#, etc.. I know some people live it, love it, thrive on it. I find it intrinsically UGLY and I'm sure that's a large part of why I struggle.

Anything CCS can do to make things more consistent is great.

---JC
_________________
---On a campaign for more examples and better docs!
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.