Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form style="margin-top: 10px" id="formSend">
- <input type="text" class="name" name="name" placeholder="Jméno" id="na" required="">
- <input type="text" class="name" name="mail" placeholder="Email" id="em" required="">
- <textarea placeholder="Vaše zpráva" id="ms" required=""></textarea>
- <input type="submit" id="btn1" style="float: right;" value="SEND MESSAGE">
- </form>
- jQuery(document).ready(function ($) {
- $(".scroll").click(function (event) {
- event.preventDefault();
- $('html,body').animate({ scrollTop: $(this.hash).offset().top }, 1000);
- });
- $("#reserve-button").click(function () {
- $("#sl").trigger("click");
- });
- $("#more-button").click(function () {
- $("#more").toggle();
- if($.trim($("#more-button").text())=="Více")
- $("#more-button").text("Méně");
- else
- $("#more-button").text("Více");
- });
- $('#formSend').submit(function (e) {
- // Prevent form submission which refreshes page
- e.preventDefault();
- });
- $('#btn1').click(function() {
- var val1 = $('#na').val();
- var val2 = $('#em').val();
- var val3 = $('#ms').val();
- if(val1=="" || val2=="" || val3=="")
- {
- return;
- }
- $.ajax({
- type: 'POST',
- url: 'mail.php',
- data: { text1: val1, text2: val2, text3: val3 },
- success: function(response) {
- alert("Odesláno");
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement