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! |
 |
 |
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!

---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
quasimidi
Posts: 151
|
| Posted: 03/19/2008, 2:57 PM |
|
LOL, glad you found it :D
_________________
RS |
 |
 |
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! |
 |
 |
|