Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html form class

Tags:

html

mysql

Is there any html form class(text box) that does not allow null values. The inputted data is to be stored in a mysql database.

like image 394
user225269 Avatar asked Sep 04 '26 11:09

user225269


2 Answers

No.

Use Javascript to check on client side if every text box is filled, and also sanitize the input on the server.

like image 61
kennytm Avatar answered Sep 07 '26 02:09

kennytm


you can using Javascript to check if text empty this function will help you just passing in form(onsubmit="return FormValidation();) i hope this code help you

function FormValidation()
    {
        if(orderform.fullname.value == "")
        {
            alert("Please enter your fullname");
            orderform.fullname.focus();
            return false;
        }
        if(orderform.email.value == "")
        {
            alert("Please enter your email");
            orderform.email.focus();
            return false;
        }
        if(orderform.telephone.value == "")
        {
            alert("Please enter your telephone");
            orderform.telephone.focus();
            return false;
        }
        if(forgetform.txtusername.value == "Username")
        {
            alert("Please enter your Username");
            orderform.txtusername.focus();
            return false;
        }
    }
like image 21
Mahran Elneel Avatar answered Sep 07 '26 01:09

Mahran Elneel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!