Hi Ryan,
The .val() function works on an element that has a value attribute, like an input type text:
<input type="text" name="messageTitle" id="messageTitle" value="somevalue">
.val() would return (or set depending on how you called it) the value="" portion of the element.
Textareas don't have a value="" attribute. They have an opening and closing tag and everything in between that appears in the text area:
<textarea id="messageBody">
I appear in the text box called 'messageBody'
</textarea>
So what you want to use there is either the .text() or .html() functions. I can't off hand remember the difference between the two, but the jQuery docs would spell it out, I'm sure. Try one of those, and I'm sure you'll be on your way. :o)
Cheers!
Chris
----- Original Message -----
From: "Ryan" <ksu_stud@...>
To: ajaxcfc@yahoogroups.com
Sent: Wednesday, April 16, 2008 9:39:44 AM (GMT-0600) America/Chicago
Subject: [ajaxcfc] Re: ajaxCFC w/ jquery
Chris,
Thanks again for your help I have gotten things working again.
One more issue. I am trying to clear the values out of a text field
and a textarea with the jQuery syntax.. the text field (messageTitle)
clears but the textarea (messageBody) does not. Any ideas?
$('#messageBody').val('');
$('#messageTitle').val('');
Obviously I know that textareas do not have a value parameter but I'm
pretty sure that the .value property worked with ajaxCFC standalone.
I've tried .text('') and .html('') with no luck. How can I clear out
the contents of a text area?
Thanks,
Ryan
--- In ajaxcfc@yahoogroups.com, Chris Jordan <cjordan@...> wrote:
>
> Ryan,
>
> The proper jQuery that you want is:
>
> $('#layerSpan').html(getResult);
>
> Check out this page (http://docs.jquery.com/Manipulation) for some
useful jQuery functions along these lines.
>
> Not sure I understand the question about the callback function,
sorry. Maybe ask it again, and I'll pay attention this time. ;o)
>
> As for snippets, check out cfeclipse.org
(http://cfeclipse.org/cfeclipsetv.cfm). The link I just gave goes to
a video section of the site, and the second video clip down (07... I
think) is about using snippets. It's pretty cool. You can (or
could... I can't seem to find anything about it right now) connect to
a shared snippet server and automatically get loads and loads of
predefined snippets. I usually stick to using my own handful of them,
though.
>
> Hope this stuff helps. :o)
>
> Chris
>
> ----- Original Message -----
> From: "Ryan" <ksu_stud@...>
> To: ajaxcfc@yahoogroups.com
> Sent: Wednesday, April 9, 2008 8:10:54 AM (GMT-0600)
America/Chicago
> Subject: [ajaxcfc] Re: ajaxCFC w/ jquery
>
>
>
>
>
>
>
> Chris,
> Thanks again for your help. Your suggestion did work and the ajax
> code picked up the value for locationID. But now my return function
> won't work. I'm guessing it is the same sort of deal needing the #
> sign. Can you help me out here?
>
> function showPlayers(getResult)
> {
> $('#layerSpan').innerHTML = getResult;
> }
>
> I did take a look at your tutorials last night and it appears the
> game has changed!! I can't believe how different it appears to be.
> Is there a new way I shoudl be calling my return function above?
>
> Also can you point me in a good spot to learn about snippets? You
> mentioned it on your blog but I've never used them and I do use
> CFEclipse.
>
> Ryan
>
> --- In ajaxcfc@yahoogroups.com , Chris Jordan <cjordan@> wrote:
> >
> > Ryan,
> >
> > The first thing that jumps out at me is that in your line of
jQuery
> there, you're getting an id, but you're missing the pound sign that
> goes along with doing that. In other words, that line should read:
> >
> > locationId = $('#locationId').value;
> >
> > The other thing is that the '.value' part should be '.val()'. So,
> >
> > locationId = $('#locationId').val()
> >
> >
> > See if any of that helps. Also, have you checked out the
tutorials
> on my blog? ( http://cjordan.us/index.cfm/AjaxCFC )
> >
> > Hope this helps,
> > Chris
> >
> > ----- Original Message -----
> > From: "Ryan" <ksu_stud@>
> > To: ajaxcfc@yahoogroups.com
> > Sent: Tuesday, April 8, 2008 4:47:58 PM (GMT-0600)
America/Chicago
> > Subject: [ajaxcfc] ajaxCFC w/ jquery
> >
> >
> >
> >
> >
> >
> >
> > Hey Guys,
> > It's been a while but I'm back writing code. I downloaded the
> latest
> > version of ajaxCFC which has jQuery included. The ajaxCFC code
> seems
> > to be working fine until I try to include the jquery.js file like
> so
> >
> > <script src="../ajaxcfc/branches/jquery/core/js/jquery.js"
> > type="text/javascript"></script>
> >
> > Once I inlcude the file I start getting undefined errors when
> making
> > simple calls like...
> >
> > locationID = $('locationID').value;
> >
> > Any ideas? I think jquery uses the $ function, is that the issue?
> >
> > Thanks,
> > Ryan
> >
>