Subversion-Projekte lars-tiefland.zeldi.de

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2 lars 1
    $(function()
2
    {
3
        $('#nicht_gefunden_msg').dialog({
4
            modal:true,
5
            resizable:false,
6
            width:800,
7
            autoOpen:false,
8
            buttons:
9
            {
10
                'OK':function()
11
                {
12
                    $(this).dialog("close");
13
                }
14
            }
15
        })
16
        // ME: das nichGefunden-Modul ein/ausblenden
17
        $('.not_found_small').button().click(function(){
18
            $('#ng_top').toggle();
19
            $('.not_found_small').toggle();
20
            return false;
21
        });
22
        $('#close_ng').click(function(){
23
            $('#ng_top').toggle();
24
            $('.not_found_small').toggle();
25
        });
26
        $('.not_found_small_bottom').button().click(function(){
27
            $('#ng_bottom').toggle();
28
            $('.not_found_small_bottom').toggle();
29
        });
30
        $('#close_ng_bottom').click(function(){
31
            $('#ng_bottom').toggle();
32
            $('.not_found_small_bottom').toggle();
33
        });
34
 
35
        $('#send_ng').button().click(function(event){
36
            event.preventDefault();
37
            checkForm();
38
        });
39
        $('#send_ng_bott').button().click(function(event){
40
            event.preventDefault();
41
            checkBottForm();
42
        });
43
    });
44
    function checkForm()
45
    {
46
        brand = $('#brand').val();
47
        type = $('#type').val();
48
        name = $('#name').val();
49
        comment = $('#comment').val();
50
        e_mail=$('#email').val();
51
        //company=$('#company').val();
52
        //captcha = $('#captcha').val();
53
        if(brand=="")
54
        {
55
            alert("Bitte geben Sie einen Hersteller ein!");
56
            $('#brand').focus();
57
            return false;
58
        }else if(brand.indexOf('://')!=-1) {
59
            alert("Bitte geben Sie keine URL ein.");
60
            $('#brand').focus();
61
            return false;
62
        }
63
        if(type=="")
64
        {
65
            alert("Bitte geben Sie Produktdetails ein!");
66
            $('#type').focus();
67
            return false;
68
        }else if(type.indexOf('://')!=-1) {
69
            alert("Bitte geben Sie keine URL ein.");
70
            $('#type').focus();
71
            return false;
72
        }
73
        if(name=="")
74
        {
75
            alert("Bitte geben Sie Ihren Namen ein!");
76
            $('#name').focus();
77
            return false;
78
        }else if(name.indexOf('://')!=-1) {
79
            alert("Bitte geben Sie keine URL ein.");
80
            $('#name').focus();
81
            return false;
82
        }
83
        if(comment.indexOf('://')!=-1) {
84
            alert("Bitte geben Sie keine URL ein.");
85
            $('#comment').focus();
86
            return false;
87
        }
88
        if(e_mail=="")
89
        {
90
            alert("Bitte geben Sie Ihre E-Mail Adresse ein!");
91
            $('#email').focus();
92
            return false;
93
        }else if(e_mail.indexOf('://')!=-1) {
94
            alert("Bitte geben Sie keine URL ein.");
95
            $('#email').focus();
96
            return false;
97
        }
98
/*
99
        if(company=="")
100
        {
101
            alert("Bitte geben!");
102
            $('#company').focus();
103
            return false;
104
        }
105
        */
106
        $.ajaxSetup({
107
            'async':false
108
        });
109
        setTimeout('code_result("top")',10);
110
        /*
111
        $('#ret').load("/module/reiter/check_code.php",{code:captcha},function()
112
        {
113
 
114
        });
115
        */
116
    }
117
    function checkBottForm()
118
    {
119
        brand = $('#brand_bott').val();
120
        typ = $('#typ_bott').val();
121
        name = $('#name_bott').val();
122
        e_mail=$('#email_bott').val();
123
        company=$('#company_bott').val();
124
        captcha = $('#captcha_bott').val();
125
        if(brand=="")
126
        {
127
            alert("Please enter a product name!");
128
            $('#brand_bott').focus();
129
            return false;
130
        }
131
        if(typ=="")
132
        {
133
            alert("Please enter the product details!");
134
            $('#typ_bott').focus();
135
            return false;
136
        }
137
        if(name=="")
138
        {
139
            alert("Please enter your name!");
140
            $('#name_bott').focus();
141
            return false;
142
        }
143
        if(e_mail=="")
144
        {
145
            alert("Please enter your email-address!");
146
            $('#email_bott').focus();
147
            return false;
148
        }
149
        if(company=="")
150
        {
151
            alert("Please enter the name of your company!");
152
            $('#company_bott').focus();
153
            return false;
154
        }
155
        $.ajaxSetup({
156
            'async':false
157
        });
158
        $('#ret').load("/module/reiter/check_code.php",{code:captcha},function()
159
        {
160
            setTimeout('code_result("bottom")',10);
161
        });
162
    }
163
 
164
    function code_result(where)
165
    {
166
        /*html=$('#ret').html();
167
        if(html!="OK")
168
        {
169
            alert(html);
170
            /*
171
            if(where=="top")
172
            {
173
                $('#captcha').focus();
174
            }
175
            else
176
            {
177
                $('#captcha_bott').focus();
178
            }
179
 
180
        }
181
        else
182
        {*/
183
            if(where=="top")
184
            {
185
                $('#ng-form').submit();
186
            }
187
            else
188
            {
189
                $('#ng-form_bott').submit();
190
            }
191
            //document.location.href="/";
192
        //}
193
    }