On 8 August 2012 08:46, Maddy
<ashokkumar-tks5Z7IV8F8RmelmmXo44Q@public.gmane.org>
wrote:> It is my jquery/ajax coding.
> it is not not working now.
Since you have not told us what it is supposed to do and what the
problem is then we have little chance of helping. I suggest you strip
your code down to a very simple starting point with no more than three
or four lines of code. Get that working then add to it to get to what
you want.
Colin
>
> $(document).ready(function() {
>
> $(".ac_odd").live(''click'', function() {
> alert(''odd'');
> var s_name = $(this).text();
> $(''.sport-name'').val($(this).text());
>
$(''.ac_results'').css(''display'',''none'');
> var sport_id = 22
> $.get(
"/users/8/sport_subscriptions/"+sport_id+"/form_fields/?sport_name="+s_name+"&is_new=yes",
> "",
> function(data) {
>
$("#extra_form_fields").html(data);
> if
($("#extra_form_fields").find("form").length == 1) {
> // strip the superfluous <form> tag
>
$("#extra_form_fields").html($("#extra_form_fields").find("form").html());
> }
> return false;
> });
> });
>
> $(".ac_even").live(''click'', function() {
> alert(''even'');
> var s_name = $(this).text();
> $(''.sport-name'').val($(this).text());
>
$(''.ac_results'').css(''display'',''none'');
> var sport_id = 22
> $.get(
"/users/8/sport_subscriptions/"+sport_id+"/form_fields/?sport_name="+s_name+"&is_new=yes",
> "",
> function(data) {
>
$("#extra_form_fields").html(data);
> if
($("#extra_form_fields").find("form").length == 1) {
> // strip the superfluous <form> tag
>
$("#extra_form_fields").html($("#extra_form_fields").find("form").html());
> }
> return false;
> });
> });
>
> --
> You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
> To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
> To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/yRMYJjn_picJ.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.