I have the following going on in my page, and I can''t for the life of
me figure out where I went wrong.
<script type="text/javascript">
function changecat(catid)
{
var params = {
method: ''get'',
parameters: Form.serialize(catid),
asynchronous:true, // Default behavior. Not needed.
evalScripts:true
};
new
Ajax.Updater(''div123'',''/ajax/changecategory.php'',
params);
//alert(params);
}
</script>
and then on my page I have:
<div id="div123">
Results Here
</div>
<form id="cat_555" name="cat_555">
<select name="category" onchange=
"changecat(''cat_555'');" >
<option value="6xx">Entertainment</option>
<option value="34x6">Entertainment : Celebrity</option>
</select> </form>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
i think you need to have the braces in there
new
Ajax.Updater(''div123'',''/ajax/changecategory.php'',
{params});
On Wed, Apr 30, 2008 at 4:44 PM, Scott Phillips
<drbigfresh-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
>
> I have the following going on in my page, and I can''t for the life
of
> me figure out where I went wrong.
>
> <script type="text/javascript">
> function changecat(catid)
> {
> var params = {
> method: ''get'',
> parameters: Form.serialize(catid),
> asynchronous:true, // Default behavior. Not needed.
> evalScripts:true
> };
>
> new
Ajax.Updater(''div123'',''/ajax/changecategory.php'',
params);
> //alert(params);
> }
> </script>
>
> and then on my page I have:
>
> <div id="div123">
> Results Here
> </div>
>
>
> <form id="cat_555" name="cat_555">
> <select name="category" onchange=
"changecat(''cat_555'');" >
> <option value="6xx">Entertainment</option>
> <option value="34x6">Entertainment :
Celebrity</option>
> </select> </form>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
I can''t figure out what is wrong either. Can you tell us what is happening? -justin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
It isn''t seeing the category select field. When I change it, it fires the script, but nothing is getting passed to the PHP page. Assumed I was doing something wrong with Form.serialize, but can''t seem to find it. On Apr 30, 1:58 pm, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I can''t figure out what is wrong either. Can you tell us what is happening? > > -justin--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
parameters: $(catid).serialize(true); maybe? On Apr 30, 4:44 pm, Scott Phillips <drbigfr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have the following going on in my page, and I can''t for the life of > me figure out where I went wrong. > > <script type="text/javascript"> > function changecat(catid) > { > var params = { > method: ''get'', > parameters: Form.serialize(catid), > asynchronous:true, // Default behavior. Not needed. > evalScripts:true > > }; > > new Ajax.Updater(''div123'',''/ajax/changecategory.php'', params); > //alert(params);} > > </script> > > and then on my page I have: > > <div id="div123"> > Results Here > </div> > > <form id="cat_555" name="cat_555"> > <select name="category" onchange= "changecat(''cat_555'');" > > <option value="6xx">Entertainment</option> > <option value="34x6">Entertainment : Celebrity</option> > </select> </form>--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Got it working.. was:
<script type="text/javascript">
function changecat(catid){
var params = Form.serialize($(catid));
new Ajax.Updater(''div123'',
''/ajax/changecategory.php'',
{asynchronous:true, parameters:params});
alert(catid);
}
</script>
On Apr 30, 2:19 pm, blechler
<lech...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> parameters: $(catid).serialize(true);
>
> maybe?
>
> On Apr 30, 4:44 pm, Scott Phillips
<drbigfr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > I have the following going on in my page, and I can''t for the
life of
> > me figure out where I went wrong.
>
> > <script type="text/javascript">
> > function changecat(catid)
> > {
> > var params = {
> > method: ''get'',
> > parameters: Form.serialize(catid),
> > asynchronous:true, // Default behavior. Not needed.
> > evalScripts:true
>
> > };
>
> > new
Ajax.Updater(''div123'',''/ajax/changecategory.php'',
params);
> > //alert(params);}
>
> > </script>
>
> > and then on my page I have:
>
> > <div id="div123">
> > Results Here
> > </div>
>
> > <form id="cat_555" name="cat_555">
> > <select name="category" onchange=
"changecat(''cat_555'');" >
> > <option value="6xx">Entertainment</option>
> > <option value="34x6">Entertainment :
Celebrity</option>
> > </select> </form>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---