[i]Hi, I have a problem to create a form. I have a activeDropDownList to select some values and launch an event depending of the selected value, then show or hide some form fields or elements
but I really don’t know how to go ahead. inside the controller I will put the logic that I want to return to update the form, but I don’t know how to do it
I try with the expample of cookbook but nothing, don’t work. The first problem is ajaxAction is never called.
I really would like to make something like the link "Click to configure post options" present in this page when start or replay a new post. Something to expand and show when the user select an option.
thanks Tommy, but I saw the article before post, and doesn’t work for me.
As I said, would like to do something like the "Click to configure post options" in this page but follow the example on cookbook I never get a good result: this is my code:
[indent][indent]'ajax' => array(
'type'=>'POST', //request type
'url'=>'createlinks', //url to call
//'update'=>'#linktag', //selector to update
//'data'=>'js:javascript statement'
//leave out the data key to pass all form values through
))); [/indent][/indent]
Please tell us more about what you try to accomplish. Did you include the dropdownlist in a form. What do you want to do with the value you get back from the controller.
Tommy in my controller I would like to show or not one or more divs. the result of the ajax operation I need to know what divs should I to show in case of the selected kind of user (editor, administrator, etc). For editor I could ask for the news topics, but for administrators I can ask for another thing. I just something like that.
Since you probably do not want to include the dropDownList itself in the block being replaced you will not get into event rebinding issues.
Based on this I tested (a while ago) to select a user from the dropdown and display the complete user record. That part is easy, in your case it might need more effort based on what information you want to display.