Subversion-Projekte lars-tiefland.cienc

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

$(function()
{
    $('#neu').attr("disabled","disabled").click(check_form);
    $("input[type=radio].position").click(check_pos);
    function check_pos()
    {
        $('#neu').removeAttr("disabled");
    }
    $('#bild_row').hide();
    $('#text_row').hide();
    $('#link_row').hide();
    $('#typ').change(toggle_untertyp);
    
    function toggle_untertyp()
    {
        val=$(this).val();
        if(val=="standard")
        {
            $('#untertyp_row').show();
            $('#bild_row').hide();
            $('#text_row').hide();
            $('#link_row').hide();
        }
        else
        {
            $('#untertyp_row').hide();
            $('#bild_row').show();
            $('#text_row').show();
            $('#link_row').show();
        }
    }
    
    function check_form(event)
    {
        type=$('#typ').val();
        stype=$('#untertyp').val();
        if(type=="0")
        {
            alert("Bitte einen Typ wählen!");
            return false;
        }
        if(type=="standard" && stype==0)
        {
            alert("Bitte einen Untertyp wählen!");
            return false;
        }
    }    
});