In this case, there's something wrong with the path "top.mainFrameSet.main" ... it's
typod or otherwise misspelled, or the spelling doesn't have the right case. Once
you've got that figured out, hopefully the function will be able to access that form
field.
> 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.Image
>>> Na
>>> 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/uns
> ubscribe.cfm?user=633.558.4
s. isaac dealey 972-490-6624
new epoch http://www.turnkey.to
lead architect, tapestry cms http://products.turnkey.to
tapestry api is opensource http://www.turnkey.to/tapi
team macromedia volunteer http://www.macromedia.com/go/team
certified advanced coldfusion 5 developer
http://www.macromedia.com/v1/handlers/index.cfm?ID=21816
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4