jQuery select ändern ein - /ausblenden von div-event

Ich versuche ein Formular erstellen, das, wenn das select-element 'Paket' ausgewählt ist es wird dann ein div aber, wenn es nicht ausgewählt ist, würde ich gerne ausblenden, div. Hier ist mein markup im moment:

Dies ist mein HTML so weit..

    <div class="row">    
    Type
        <select name="type" id="type" style="margin-left:57px; width:153px;">
                <option ame="l_letter" value="l_letter">Large Letter</option>
                <option name="letter" value="letter">Letter</option>
                <option name="parcel" value="parcel">Parcel</option>
        </select>                    
</div>

<div class="row" id="row_dim">
    Dimensions
        <input type="text" name="length" style="margin-left:12px;" class="dimension" placeholder="Length">
        <input type="text" name="width" class="dimension" placeholder="Width">
        <input type="text" name="height" class="dimension" placeholder="Height">
</div> 

Dies ist mein jQuery so weit..

  $(function() {
    $('#type').change(function(){
        $('#row_dim').hide(); 
        $("select[@name='parcel']:checked").val() == 'parcel').show();   
    });
});
InformationsquelleAutor user2716389 | 2013-09-02
Schreibe einen Kommentar