PageSourceSearch

https://hkobir.github.io/js/form-validation.js

js hkobir.github.io collected 2026-10-03 09:18:12 UTC 2,060 bytes, 86 lines download raw bytes

1$(document).ready(function(){
2    $("#myForm").validate({
3        rules: {
4
5            email: {
6                required: true,
7                email: true
8            },
9
10            name: {
11                required: true,
12                minlength: 4
13            },
14
15            message: {
16                required: true
17
18
19            }
20
21        },
22        messages: {
23
24            email: "Please enter a valid email address",
25
26            name: {
27                required: "Please provide your name",
28                minlength: "Your name must be at least 4 characters long"
29            },
30            message: {
31                required: "Please provide your message",
32
33            }
34        }
35    });
36
37
38    //5bb7fecdff319974e681a4c1c2718e4c-us8
39    $('#myForm').submit(function() {
40        
41        
42        // get all the inputs into an array.
43        var $inputs = $('#myForm :input');
44
45        // not sure if you wanted this, but I thought I'd add it.
46        // get an associative array of just the values.
47        var values = {};
48        $inputs.each(function() {
49            values[this.name] = $(this).val();
50        });
51
52
53        //sending mail
54
55        $.ajax({
56            type: "POST",
57            url: "https://mandrillapp.com/api/1.0/messages/send.json",
58            data: {
59                "key": "5bb7fecdff319974e681a4c1c2718e4c-us8",
60                "message": {
61                    "from_email": values['email'],
62                    "to": [
63                        {
64                            "email": "[email protected]",
65                            "name": "HKobir",
66                            "type": "to"
67                        }
68                    ],
69                    "autotext": "true",
70                    "subject": values['subject'],
71                    "html": values['message']
72                }
73            }
74        }).done(function(response) {
75            console.log(response); // if you're into that sorta thing
76            Swal.fire('mail has been sent')
77            
78
79        });
80
81        
82    });
83
84
85
86});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.