Search code examples
jqueryniceforms

jQuery event on NiceForms drop down change


Im using niceForms to make my drop downs and below is what I have in my html

<select style="width:1px;" class="NFhidden" size="1" id="aics_Enquiry" name="aics_Enquiry">
    <option value="0">General enquiry</option>
    <option value="1"> Request a statement</option>
    <option value="2"> Feedback</option>
    <option value="3"> Other</option>
</select>

But when I use firbug on my drop down item, it shows the following html too which I just cant see on my Source code if I view it on the browser.

 <dd style="width:" class="relative fl">
 <div class="NFSelect" style="width: 5px; left: 767px; top: 593px; z-index: 999;"><img src="/templates/liberty/images/0.png" class="NFSelectLeft">
 <div class="NFSelectRight">Feedback</div>
 <div class="NFSelectTarget" style="display: none;">
 <ul class="NFSelectOptions">
 <li><a href="javascript:;">General enquiry</a></li>
 <li><a href="javascript:;">Request a statement</a></li>
 <li><a href="javascript:;" class="NFOptionActive">Feedback</a></li>
 <li><a href="javascript:;">Other</a></li>
 </ul>
 </div>
 </div>
 <select style="width:1px;" class="NFhidden" size="1" id="aics_Enquiry" name="aics_Enquiry">
 <option value="0">General enquiry</option>
 <option value="1"> Request a statement</option>
 <option value="2"> Feedback</option>
 <option value="3"> Other</option>
 </select>
 </dd>

My question is, I want to trigger a jquery event when someone changes the menu to 'Feedback' drop down item. How can I do this?


Solution

  • With jQuery'schange()

    $("#aics_Enquiry").change( function(){
     if(this.value == 2){
      //TODO: implement solution
     }
    });