Web Images Videos Maps News Shopping Gmail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How to capture value from the drop down list
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Sheetal  
View profile  
 More options Jul 2, 7:02 pm
From: Sheetal <radha...@gmail.com>
Date: Thu, 2 Jul 2009 16:02:06 -0700 (PDT)
Local: Thurs, Jul 2 2009 7:02 pm
Subject: How to capture value from the drop down list
I have a drop down list consisting of 'status' values. Each city has
its own id and  and a set of colors for it.
Below is my requirement :
1. If a user selects a 'status' value from the drop down, I have to
ask the user "if he/she is confirmed with the selected status".
2. If 'no' nothing should happen
3. If "yes", I should get the values of colors associated with that
particular status.
4. All the above should happen WITHOUT reloading the page.

color values are stored in mysql database.

How to acheive this using cakePHP?
Please help me in this.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
hoyos  
View profile  
 More options Jul 2, 10:31 pm
From: hoyos <andrew.hatte...@gmail.com>
Date: Thu, 2 Jul 2009 19:31:49 -0700 (PDT)
Local: Thurs, Jul 2 2009 10:31 pm
Subject: Re: How to capture value from the drop down list
It sounds like you have a pretty complex form there.

From your description, it sounds like you will need to use the CakePHP
Ajax helper here: http://book.cakephp.org/view/208/AJAX

Read about it in the introduction and in online tutorials, there are a
couple Javascript libraries you have to download in order to use it.

Specifically, take a look at the $ajax->observeField method here:
http://book.cakephp.org/view/630/observeField

I am guessing you will want to use the ObserveField call to watch for
which status they choose, and load the "colors" through an ajax call.

-A

On Jul 2, 4:02 pm, Sheetal <radha...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
brian  
View profile  
 More options Jul 3, 1:55 pm
From: brian <bally.z...@gmail.com>
Date: Fri, 3 Jul 2009 13:55:53 -0400
Local: Fri, Jul 3 2009 1:55 pm
Subject: Re: How to capture value from the drop down list

This would be very easy using jQuery. Just include the library along
with something like the following:

$(function()
{
        $('#id_of_your_select').change(function()
        {
                var status = $(this).val();

                if (confirm('your confirmation message'))
                {
                        $.ajax({
                                url: '/path/to/controller/action',
                                data: 'status='status,
                                success:
                                        function(html)
                                        {
                                                // do something with returned color data
                                        }
                        });
                }
        });

});

The above could be saved to a separate file and included in the view like so:

echo $javascript->link('jquery.min', false);
echo $javascript->link('some_file_name', false);

If you'd rather pass the status as an action parameter, leave out the
'data' option and change url to:

url: '/path/to/controller/action/' + status


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google