0

This is the code I'm trying to execute http://jsfiddle.net/sf4nsr5c/ which works fine.

js

$('input[name=test]').click(function () {
if (this.id == "format-checkbox") {
    $("table#showfields").show();
} else {
    $("table#showfields").hide();
}
});

html

<input type="radio" name="test" id="format-checkbox"/> Check

<table id="showfields" style="display:none;">

<tr>
<td><input type="radio" name="searchfield" id="checkno"></td>                               
    <td>
        <label> Check No:</label>
    </td> 
    <td>
        <input type="text" name="checkno_search" id="checkno_search" disabled> 
        </td>
    </tr>

    <tr>
        <td><input type="radio" name="searchfield" id="checkbank"></td>
            <td>
                <label> Bank:</label>
            </td> 
            <td>
                <input type="text" name="checkbank_search" id="checkbank_search" disabled> 
                </td>
            </tr>

            <tr>
                <td><input type="radio" name="searchfield" id="checkdate"></td>
                    <td>
                        <label> Date:</label>
                    </td> 
                    <td>
                        <input type="text" name="checkdate_search" id="checkdate_search" disabled> 
                        </td>
                    </tr>

                    <tr>
                        <td><input type="radio" name="searchfield" id="checksignatory"></td>
                            <td>
                                <label> Signatory:</label>
                            </td> 
                            <td>
                                <input type="text" name="checksignatory_search" id="checksignatory_search" disabled> 
                                </td>
                            </tr></table></td></tr>

            </table>

But it isn't with my local machine. When I check "Check," nothing happens. The additional fields won't appear.

I'm new to Jquery so I'm not sure what the problem is. I am already using Jquery in other parts of the code but this one just refuse to work. I copy pasted the working code from Jquery to my Notepad++ but no luck.

I've tried the links provided here Is there a link to the "latest" jQuery library on Google APIs? Initially, I linked to a downloaded jquery file, jquery-1.9.0.min.js and tried jquery-1.9.0.js. The files are in the same folder and the code is working. Am I still doing something wrong?

Community
  • 1
  • 1
AMB Tanz
  • 3
  • 3

0 Answers0