I made the last changes you suggested and nothing happens. However, I am now getting a
javascript error: "top.mainFrameSet.main.document is null or not an object"
I also tried removing the target from my revised version to see if at least the value
would be passed to the form field, but nothing happened.
>> Isaac,
>
>> I've added '#jsstringformat(subDir & name)#' and it still
>> is not changing the value in the "ImageName" form field.
>> (The variable "name" is from a cfdirectory query.)
>
>> <a href="viewer.cfm?image=#subDir##name#" target="viewer"
>> onClick="top.mainFrameSet.main.document.frmAddItem.ImageNa
>> me.value='#jsstringformat(subDir & name)#';">#name#</a>
>
>> which returns the following example:
>
>> <a href="viewer.cfm?image=shoes/sm_002.jpg"
>> target="viewer" onClick="top.mainFrameSet.main.document.fr
>> mAddItem.ImageName.value='shoes/sm_002.jpg';">sm_002.jpg</
>> a>
>
>That's definitely proper syntax for javascript... is it producing a
>javascript error now? You might want to turn on script debugging if
>you're using Internet Explorer to test this.
>
...
>oh...
>
>target may have some affect on it... I know that if you specify a base
>target for a page, then any javascript on that page IE will attempt to
>process relative to or rather from the target frame... dunno why they
>do that, I think it's stupid personally... Anyway, you might try
>this:
>
><script language="javascript">
>function getMyImage(iName) {
>top.mainFrameSet.main.document.frmAddItem.ImageName.value=iName;
>top.mainFrameSet.viewer.location.href='viewer.cfm?image='+iName;
>}
></script>
>
><a href="javascript:getMyImage('#jsstringformat(subDir &
>name)#');">#name#</a>
>
>hth
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4