Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery check if input is empty on submit

var empty = true;
$('input[type="text"]').each(function() {
   if ($(this).val() != "") {
      empty = false;
      return false;
   }
});
Comment

jquery check if input is empty

if ($.trim($("user_name_intend").val()).length != 0 &&
            $.trim($("user_telephone_intend").val()).length != 0 &&
            $.trim($("user_email_intend").val()).length != 0 &&
            $.trim($("user_comment_intend").val()).length != 0) {
            $.ajax({
                url: "/makeOrder",
                type: "POST",
                data: {
                    quantity: 1,
                    min_quantity: 1,
                    max_quantity: 100,
                    name: $('#user_name_intend').val(),
                    telephone: $('#user_telephone_intend').val(),
                    email: $('#user_email_intend').val(),
                    comment: $('#user_comment_intend').val(),
                    product_id: {{ product_id }},
                },
                dataType: "json",
                success: function (t) {
                    $("#intendformpost").submit();
                },
            });
        } else {
            alert("Kerakli maydonlar to'ldirilmagan")
        }
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript remove last characters from string 
Javascript :: timeout javascript 
Javascript :: × MUI: makeStyles is not longer exported from @mui/material/styles. You have to import it from @mui/styles. 
Javascript :: jquery wordpress starter code 
Javascript :: javascript today minus 1 day 
Javascript :: jspdf text align center 
Javascript :: jquery datatable destroy and recreate 
Javascript :: convert a string to html element in js 
Javascript :: how to completely reload page in jquery 
Javascript :: how to make a div scrollable 
Javascript :: heroicons nextjs 
Javascript :: jquery smooth scrool 
Javascript :: react native text wrap 
Javascript :: run react app in different port 
Javascript :: javascript get length of object 
Javascript :: e vs backwards e math 
Javascript :: lowercase or uppercase all strings in array javascript 
Javascript :: Failed to transform react-native-reanimated-65.aar 
Javascript :: find intersection of multiple arrays in javascript 
Javascript :: javascript disable enter key 
Javascript :: vimeo regez video id 
Javascript :: javascript on double click 
Javascript :: javascript password generator example 
Javascript :: vue.js use scss in balise style 
Javascript :: javascript array of cumulative sum 
Javascript :: jquery get all checked checkboxes 
Javascript :: three.js create sphere 
Javascript :: confirm delete message in jquery 
Javascript :: get discord.js role 
Javascript :: javascript remove element by id 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =