Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

$(function() {
        $('#PLZ').keyup(function() {    
        var plz = $(this).val();
                var ort = $('#Ort').val();
                $('#Ort').css({background: "#fff"});

                if ( plz.length == 5 ) {
                        // --- AJAX-ABFRAGE  ---
                        $.ajax({
                                url: '/Warenwirtschaft/jscript/autoplz.php?plz=' + plz,
                                cache: false,
                                success: function(html) {
                                        if ( html ) {
                                                $('#Ort').val(html).css({background: "#0f0"});
                                        }                                               
                                }       
                        });
                        // --- /AJAX-ABFRAGE ---
                } else {
            $('#Ort').val('');
                }
        });
        
        $('#plz2').keyup(function() {   
        var plz2 = $(this).val();
                var ort2 = $('#ort2').val();
                $('#ort2').css({background: "#fff"});

                if ( plz2.length == 5 ) {
                        // --- AJAX-ABFRAGE  ---
                        $.ajax({
                                url: './includes/auto_plz/autoplz.php?plz=' + plz2,
                                cache: false,
                                success: function(html) {
                                        if ( html ) {
                                                $('#ort2').val(html);
                                                $('#ort2').css({background: "#0f0"});
                                        }                                               
                                }       
                        });
                        // --- /AJAX-ABFRAGE ---
                } else {
            $('#ort2').val('');
                }
        });
        
        $('#ort2').keyup(function() {
                $('#ort2').css({background: "#fff"});
        });
});