Oh and just to clarify (before someone else hits me on it), you don't  
need the JQuery lookup in my example of using an existing JS object.    
You can, however use the object directly to perform JQuery functions  
on the object:

var columnID = document.getElmentById("columnId");
columnID.value=columnIDsArray;

:)
Jon


On Dec 9, 2007, at 4:04 PM, Jon Clausen wrote:

> Richard,
>
> I appears that you're using JQuery so some of your questions might be
> more appropriate on the forums over there, but a couple of things:
>
> You need to pass the pound symbol in with your field so that JQuery
> knows to specifically to look for an HTML element with that id
> attribute:
>
> $('#columnID').value=columnIDsArray;
>
> If it's an existing javascript object variable, than there's no need
> to quote it:
>
> var columnID = document.getElmentById("columnId");
> $(columnId).value=columnIDsArray;
>
> I'm not exactly sure what the execution plan and fallback for JQuery
> is when the pound sign is missing.  Rey Bango would probably know, but
> it's a good bet that this may be the problem.  By using
> "document.manageLookupForm.columnID.value" you are bypassing the
> JQuery lookup of the object and accessing the DOM tree directly.
>
> In any case, I'm not sure that populating your forms with javascript
> on each step is the most effective or efficient way.   Javascript and
> a JQuery are wonderful for manipulating stuff after the document has
> loaded, but server side code can make quick and accurate work of it
> like in this (very basic) example of using the passed form structure
> to quickly populate required fields:
>
> <cfset reqFields = "name,author,title,text">
> <cfloop list="#reqFields#" index="i">
> <input type="hidden" name="#i#" id="#i#"<cfif structKeyExists(form,i)>
> value="#form[i]#<cfelse> value=""</cfif>/>
> </cfloop>
>
> You can make short work of handling the passed variables and don't
> have to rely on the browser to make sure the values are set correctly.
>
> Just my 2 cents.
>
>
> -Jon
>
>
> On Dec 9, 2007, at 3:23 PM, Richard White wrote:
>
>> ok after nearly tearing my hair out all day i still dont know what
>> was wrong but managed to fix it. if i was to set the value of the
>> hidden form fields as follows:
>>
>> $('columnID').value = columnIDsArray;
>>
>> then it was working sometimes and not others, yet if i set it as
>> follows:
>>
>> document.manageLookupForm.columnID.value = columnIDArray;
>>
>> then it works all the time????
>>
>> does anyone have any idea why this would happen.
>>
>> i have the first way set up on all my interfaces and works fine but
>> on this interface like i said it works fine with the second way but
>> not the first?
>>
>> thanks
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get involved in the latest ColdFusion discussions, product
development sharing, and articles on the Adobe Labs wiki.
http://labs/adobe.com/wiki/index.php/ColdFusion_8

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:294427
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to