Using Java Script instead post

want to use java script instead of post request, Instead of sending any request want to use js help me

You should be more descriptive… maybe give an example…

what you want to do with javascript instead of making POST request?

You mean AJAX I think, but in any case you should send the POST or GET requests :huh:

You can use this:

http://api.jquery.com/submit/

in combination with this:

http://api.jquery.com/serialize/

and this:

http://api.jquery.com/jQuery.ajax/

BTW where’s the relation to Yii in your question?

I have attach the file. In _form i hv used Post request but I want to run this without using postrequest784

_form.php

in controller I hv action call

public function actionDynamicTerm()

{

  $model=new Term;


  $dataProvider=$model->getAllTerm($_POST['id']);


  $this->renderPartial('application.components.contentTerm.views._dynamicTerm', 


  						array('dataProvider'=>$dataProvider));

}

now please help me

So you are using jQuery to make a ajax call to the controller that retrieves data for the second dropdown…

And you want to do that without a request? or you want to do that with a GET request instead of a POST request?

I just want to do that without a request, because if I use Post the request goes to server which creates more traffic it is gud if the data disappear from the second dropdown in client side itself…,

But at the moment when you are displaying the initial form you don’t have all the data for the dropdown

so when the user enters the ID you need to call the controler to get that data… I don’t see how can you do that without the request be it POST or GET

no when the page gets load the drop down box shows the data(by geting data from the database that i hv done) and both boxes have the same data, eg. first box 1 ,2,3,4 and second box 1,2,3,4 . what I want is if i select 1 ,it should disappear from the second DD box(2,3,4)

when again i select 2, the second box should show(1,3,4)and so on… I have done this using POST… Now I think its clear. If not then pls tell me using GET

Its a dependent dropdown

that is not a dependent dropdown… a dependent dropdown fills the second dropdown regarding the selected value in the first dropdown…

The problem you just described is in another thread posted by you - http://www.yiiframew…8-dropdownlist/

and there is a solution too by @BornToDrink isn’t that what you need… and again… that is not Yii related… it’s pure jQuery…

P.S. you don’t need to open a new thread to ask the same question