JQuery Onclick iş için beni görünmüyor

1 Cevap php

Benim php sayfası üç radyo düğmeleri ve iki üç dışarı aramalarda jquery tıklatın olay dizisini kullanır ve buna göre bir div değiştirir ...

İşte benim jQuery işlevi ....

$(function() {    
  $("#click_here").click(function(event) {
    event.preventDefault();
    $("#div1").slideToggle();
  });

  $("#div1 a").click(function(event) {
    event.preventDefault();
    $("#div1").slideUp();
  });
});

$(function() {
  $("#click").click(function(event) {
    event.preventDefault();
    $("#div2").slideToggle();
  });

  $("#div2 a").click(function(event) {
    event.preventDefault();
    $("#div2").slideUp();
  });
});

ve benim radyo düğmeleri

        <input type="radio" name="Modeofpayment" value="1">Cash
        <div>
          <div id="id"  style="width:411x; height:20px;">
              <input type="radio" name="Modeofpayment" id="click_here" value="2">DD
              </div>
    <div style="display: none;" id="div1">
        <div style="float:right;">
            <a href="#" class="close">[x]</a>
        </div>
    <input type="hidden" name="chkVal" id="chkVal" size="20">
        <table border="0" width="200" align="center">
           <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>College Bank Name</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtCollegeBankName' id='txtCollegeBankName' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>DD NO</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtDDNO' id='txtDDNO' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>DD Amount</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtDDAMT' id='txtDDAMT' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>DD Bank Name</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtBankName' id='txtBankName' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>Remarks</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtRemarks' id='txtRemarks' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>   


        </table>

    </div>
    <div>
          <div id="id"  style="width:411x; height:20px;">
               <input type="radio" name="Modeofpayment" id="click" value="3">Cheque
          </div>
    <div style="display: none;" id="div2">
        <div style="float:right;">
            <a href="#" class="close">[x]</a>
        </div>
    <input type="hidden" name="chkVal" id="chkVal" size="20">
        <table border="0" width="200" align="center">
           <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>College Bank Name</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtCollegeBankName' id='txtCollegeBankName' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>CHQ NO</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtDDNO' id='txtDDNO' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>CHQ Amount</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtDDAMT' id='txtDDAMT' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>CHQ Bank Name</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtBankName' id='txtBankName' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>
            <tr>
            <td style="width:5px">&nbsp;</td>
            <td class="table_label" width='100px'>Remarks</td>
            <td style="width:10px">&nbsp;</td>
            <td>
            <input type='text' name='txtRemarks' id='txtRemarks' 

            Class='text_box_height_14_width_150' >
            </td>
            <td></td>
            <td style="width:5px">&nbsp;</td>
            </tr>   


        </table>

    </div>

Varsayılan olarak ben birini seçebilirsiniz ama benim önceki radyo düğmesi seçili kalır ve benim yeni radyo düğmesini tıklayın div değiştirir ama seçili değil ... başka birini seçin olamaz ....

1 Cevap

Sağ biçimlendirme başından itibaren, sizin <input> etiketi kapatmayın.

Aslında, size giriş etiketleri herhangi birini kapatmak asla.