subscribe form.,need badly help

thorjack1990

BANNED
Joined
Feb 15, 2013
Messages
71
Reaction score
9
anyone know how to make this subscribe form


http://s1118.photobucket.com/user/roiancuares/media/subscribe_zps5454177e.jpg.html


a pop up will appear if blank the form is blank.,plz
 
Hello,

Here is an example:

yourpage.html

Code:
<html>
<head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/jquery-ui.min.js"></script> 
<script type="text/javascript">
    //<![CDATA[

    function checkform(theForm) {
    
        var d=0;
        if ($("#firstname").val() == "") {
        d=d+1;
        }
        if ($("#lastname").val() == "") {
        d=d+1;
        }
        if ($("#email").val() == "") {
        d=d+1;
        }
        if (d > 0) {
            alert("Please complete all fields!");
            return false;
        }
        theForm.submit();
        return false;
    }
    //]]>
</script>
</head>

<body>
<form id="test" action="page.php" onsubmit="checkform(this); return false;" method="POST" >
<input type="text" name="firstname" id="firstname" placeholder="First name*"><br/>
<input type="text" name="lastname" id="lastname" placeholder="Last name*"><br/>
<input type="text" name="email" id="email" placeholder="Email*"><br/>
<input type="submit" name="submit" id="submit" value="Subscribe">
</form>
</body>
</html>

You have to customize it in CSS , this is just the basic code.

Also do you need the .php page which inserts subscriptions into database ?
 
Hello,

Here is an example:

yourpage.html

Code:
<html>
<head>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/jquery-ui.min.js"></script> 
<script type="text/javascript">
    //<=!=[=C=D=A=T=A=[

    function checkform(theForm) {
    
        var d=0;
        if ($("#firstname").val() == "") {
        d=d+1;
        }
        if ($("#lastname").val() == "") {
        d=d+1;
        }
        if ($("#email").val() == "") {
        d=d+1;
        }
        if (d > 0) {
            alert("Please complete all fields!");
            return false;
        }
        theForm.submit();
        return false;
    }
    //]=]=>
</script>
</head>

<body>
<form id="test" action="page.php" onsubmit="checkform(this); return false;" method="POST" >
<input type="text" name="firstname" id="firstname" placeholder="First name*"><br/>
<input type="text" name="lastname" id="lastname" placeholder="Last name*"><br/>
<input type="text" name="email" id="email" placeholder="Email*"><br/>
<input type="submit" name="submit" id="submit" value="Subscribe">
</form>
</body>
</html>

You have to customize it in CSS , this is just the basic code.

Also do you need the .php page which inserts subscriptions into database ?

how do i specify the pop-up when one filled was blank.
when clicking the subscribe button.,it will automatically email the First name, last name, and email.,how do i make it?
sry im just a newbie with web developing
 
Code:
<form onsubmit="return checkForm(this);" action="myscript.php" method="post">
    <input type="text" name="name" />
    <input type="password" name="pass" />
    <input type="submit" value="Subscribe" />
</form>
Now, the script that handles this is up to you. Its very simple, and you won't get far in the world doing such things without learning to code... or paying someone to do it. There are services that will handle forms for you, but given the simple nature I highly recommend learning.Search for handling forms in php, assuming you are dealing with a php server and have access to writing scripts on it.
 
Last edited by a moderator:
how do i specify the pop-up when one filled was blank.
when clicking the subscribe button.,it will automatically email the First name, last name, and email.,how do i make it?
sry im just a newbie with web developing

My example will return a popup if all fields are empty or at least one.

If you want to store first name, last name and email into a database you have to create the connection and use mysql_query function for php to insert into database. Or you can use jquery $.post function to send action to a php script directly, so when press subscribe people won't be redirected to yourpage.php (page that inserts firstname,lastname,email into database).

If you want to email the Firstname,Lastname and Email to a specified email you have to use in that php page the mail() or a php mail handler.
 
well OP , check codecanyon or themeforest , you will get just what you want... happy hunting! :)
 
There's no way you'll learn how to make that form functional by asking advices on a forum, it may look really simple to programmers like DeJohn, but you need to know HTML, PHP and Javascript at least at a basic level just to follow the instructions.
At your current level, i presume close to zero, your best bet is to pay someone to make it functional. Or beg.
 
Hello,

Here is an example:

yourpage.html

Code:
<html>
<head>
     
<script type="text/javascript">
    //<=!=[=C=D=A=T=A=[

    function checkform(theForm) {
    
        var d=0;
        if ($("#firstname").val() == "") {
        d=d+1;
        }
        if ($("#lastname").val() == "") {
        d=d+1;
        }
        if ($("#email").val() == "") {
        d=d+1;
        }
        if (d > 0) {
            alert("Please complete all fields!");
            return false;
        }
        theForm.submit();
        return false;
    }
    //]=]=>
</script>
</head>

<body>
<form id="test" action="page.php" onsubmit="checkform(this); return false;" method="POST" >
<input type="text" name="firstname" id="firstname" placeholder="First name*"><br/>
<input type="text" name="lastname" id="lastname" placeholder="Last name*"><br/>
<input type="text" name="email" id="email" placeholder="Email*"><br/>
<input type="submit" name="submit" id="submit" value="Subscribe">
</form>
</body>
</html>

You have to customize it in CSS , this is just the basic code.

Also do you need the .php page which inserts subscriptions into database ?

Thx for this code, I will keep it for my projects :)

Thorjack1990: By using JS to avoid errors on submit, you won't protect yourself against bots.
 
Back
Top