> 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.)
Actually I hadn't even noticed the word name in there -- it's not relevant in that
context anyway because that's a coldfusion variable, not a JavaScript variable, so
that's not an issue (although you may want to qualify the variable with the name of
the cfdirectory query, i.e. "cfdir.name" rather than "name".
> <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
> Thanks, Stan
>>You're missing single quotes in your onclick event... try
>>this:
>>
>>onClick="top.mainFrameSet.main.document.frmAddItem.Image.
>>value='#jsstringformat(subDir & name)#';"
>>
>>I _think_ javascript should be graceful enough to allow
>>you to have
>>Image as the name of that field... never name a form field
>>"name"
>>"action" or "target" -- this will prevent js code from
>>accessing the
>>form's name, action or target attributes... they are
>>case-sensitive,
>>however, so "NAME" is fine if confusing. :)
>>
>>hth
>>
>>s. isaac dealey 972-490-6624
>>
>>> Tim,
>>> Changed it to ImageName and still the same thing.
>>> Thanks, Stan
>>
>>>>First thing I would do would be to change the field name
>>>>to something other
>>>>than Image. IMage is an object in js and that may be a
>>>>cause for your
>>>>problem. Even if you just try changing all refrences to
>>>>it to img or
>>>>imgField or something.
>>>>
>>>>Tim
>>>>----- Original Message -----
>>>>From: "Stan Winchester" <[EMAIL PROTECTED]>
>>>>To: "CF-Talk" <[EMAIL PROTECTED]>
>>>>Sent: Monday, July 14, 2003 10:38 PM
>>>>Subject: iframe & form javascript
>>>>
>>>>
>>>>> I've got a form with two nested iframes that are
>>>>> side-by-side. The one of
>>>>> the left shows a directory listing of images, the one
>>>>> on
>>>>> the right is an
>>>>> image viewer. Below is the link that is used in the
>>>>> left
>>>>> iframe (this is
>>>>> inside a cfloop). When a user clicks on the link the
>>>>> image views properly,
>>>>> but I also want the image path & name values to be
>>>>> passed to a form field
>>>>> name "Image" that resides the form.
>>>>>
>>>>> <a href="viewer.cfm?image=#subDir##name#"
>>>>> target="viewer"
>>>>>
>>>>onClick="top.mainFrameSet.main.document.frmAddItem.Image
>>>>.v
>>>>alue=#subDir##name
>>>>> #;">#name#</a>
>>>>>
>>>>> The problem is the path & name values are not getting
>>>>> passed to the field
>>>>> name "Image". I'm not getting any javascript errors,
>>>>> but
>>>>> it does not work.
>>>>>
>>>>> Thank you,
>>>>> Stan Winchester
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~|
> 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
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4