Hello all,
I am creating an application in which I have two drop-down lists, when
one changes, the contents of the other are changed. Like selecting
country and states.
I am using Symfony with Doctrine and want to use jQuery for this
asynchronous task. here's where I am right now...
web/js/my_script.js
---------------------------------------
$(document).ready(function() {
$('select#country').change(function() {
$.ajax({
url: "myModule/myAction?id=" + this.value,
dataType: "text/html",
success: (function(data) {
$('select#states').html(data);
}) }); }); });
myModule/actions/actions.class.php
--------------------------------------------------
public function executeMyAction(sfWebRequest $request)
{
// The static value here will be replaced with logic to
// generate the real string
$this->list = "<option>WA</option><option>CA</option>";
}
myModule/templates/myActionSuccess.php
-----------------------------------------------------------
<?php echo $list ?>
I am stuck up in this where nothing happens when I select a country.
How can I check whether the url is found by the jQuery or not ?
Thanks and Regards
Vikram
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---