JSFiddle - React, Tailwind, and code Playground

by pramendra

HTML

<html>
    <head></head>
    <body>
        <form name="f" method="get" action="#" 
onsubmit="return checkForm()">
            <input type="text" name="zoom_query">
            <input type="submit" name="submit"> 
</form>
    </body>
</html>

JavaScript

function checkForm(f) {
    if (f.elements['zoom_query'].value == "" || "Search - Movie or Actor") {
        f.zoom_query.focus();
        return false;
    } else {
        f.submit();
        return false;
    }
}

unction Blank_TextField_Validator()
{
// Check the value of the element named text_name
// from the form named text_form
if (text_form.text_name.value == "")
{
// If null display and alert box
alert("Please fill in the text field.");
// Place the cursor on the field for revision
text_form.text_name.focus();
// return false to stop further processing
return (false);
}
// If text_name is not null continue processing
return (true);
}