Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>See code below:</p> <p>giving code from my project loads segment, sub-segments of ship type. same as country ,state</p> <p>first make parent drop down as usual like this :</p> <pre><code> &lt;?php echo $this-&gt;formSelect('segment','none',array('class' =&gt; 'select-advanced', 'width' =&gt; '250'),$this-&gt;arrInput['shiptype']); ?&gt; </code></pre> <p>here arrInput['shiptype'] is from controllar</p> <p>make a div for child drop down on ur form</p> <p>Now put below jquery code on ur form:</p> <pre><code>&lt;script&gt; var base_path = "&lt;?php echo $this-&gt;baseUrl();?&gt;/"; $('#segnam').change(function() { var segId=document.getElementById('segment').value; $.ajax({ url: base_path + "search/subseg/", data: "segId="+segId, type: 'GET', success: function (resp) { document.getElementById('subsegdiv').innerHTML=resp;}, error: function(e){ alert('Error: '+e); } }); }); &lt;/script&gt; </code></pre> <p>now for child drop dowm in yor controllar make a action :</p> <pre><code>public function subsegAction() { $request = $this-&gt;getRequest(); $objShiptype = new Shiptype(); $segId=$request-&gt;getParam('segId'); $SubSegArr=$objShiptype-&gt;getSubSegment($segId); $this-&gt;_helper-&gt;layout-&gt;disableLayout(); $this-&gt;getResponse()-&gt;setHeader('Content-Type', 'text/javascript'); $this-&gt;view-&gt;subseg=$SubSegArr; } </code></pre> <p>now make a view for above action:</p> <p>make html drop down (child) using html take data from subseg controller </p> <p>here refer segment = country subseg = state </p> <p>for city follow same make a action and view and jquery code again.</p> <p>If not clear u are free to ask. I have donw this task. It's tricky :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload