Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

empty the value of an input in jquery

$('#field').val('');
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

all input value empty jquery

// Behold the power of JQuery.
$('#myform')[0].reset();
Comment

jquery select input with empty value

$('input:text').filter(function() { return $(this).val() == ""; });
Comment

PREVIOUS NEXT
Code Example
Javascript :: Sort objects of objects by nested property 
Javascript :: react js marked import and use 
Javascript :: how to sort array without using sort method in javascript 
Javascript :: js read text file line by line 
Javascript :: round js 
Javascript :: how to target child element of an event object in JS 
Javascript :: push an property and value to an object in javascript 
Javascript :: mongoose reset database 
Javascript :: sweet alert in java Script 
Javascript :: loop elements in javascript 
Javascript :: fetch catch 
Javascript :: replace all js 
Javascript :: javascript test if string starts with alphabet 
Javascript :: reactnode prop-types 
Javascript :: javascript close window on button click 
Javascript :: set default date today js 
Javascript :: remove item from array by value 
Javascript :: deep merge nested objects javascript 
Javascript :: lodash pick 
Javascript :: js string to json 
Javascript :: bcryptjs.hash 
Javascript :: jquery ajax get with authentication 
Javascript :: javascript reduce 
Javascript :: redirect in vue 
Javascript :: generate random string react 
Javascript :: square node js 
Javascript :: set css var with javascript 
Javascript :: Random Integer 1-10 
Javascript :: for of js 
Javascript :: generate component in angular 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =