How can I call the "validation" function with this form?
<p>I just want to know how to call a function with a form that has no submit button? Because with my code at the moment it does not work. If I have a form like this in my <strong>signup.php</strong></p>

<pre><code>&lt;?php
     include 'connect.php';
     include 'header.php';

            echo '&lt;h2&gt;Register&lt;/h2&gt;';
            echo '
            &lt;div class="container"&gt;  
                &lt;form id="submit" method="post" action="" onsubmit="return formValidating();"&gt;  
                    &lt;fieldset&gt;  
                        &lt;legend&gt; Enter Information &lt;/legend&gt;  
                            &lt;br/&gt;
                                &lt;label for="user_name"&gt;Your username: &lt;/label&gt;
                            &lt;br/&gt;
                                &lt;input id="user_name" class="text" name="user_name" size="20" type="text"&gt;
                            &lt;br/&gt;


                            &lt;br/&gt;
                                &lt;label for="user_pass"&gt;Your password: &lt;/label&gt;
                            &lt;br/&gt;
                                &lt;input id="user_pass" class="text" name="user_pass" size="20" type="password"&gt;  
                            &lt;br/&gt;




                            &lt;br/&gt;
                                &lt;label for="user_pass_check"&gt;Confirm password: &lt;/label&gt;
                            &lt;br/&gt;
                                &lt;input id="user_pass_check" class="text" name="user_pass_check" size="20" type="password"&gt;
                            &lt;br/&gt;




                            &lt;br/&gt;
                                &lt;label for="user_email"&gt;Email: &lt;/label&gt;
                            &lt;br/&gt;
                                &lt;input id="user_email" class="text" name="user_email" size="20" type="email"&gt;
                            &lt;br/&gt;
                            &lt;br/&gt;
                                &lt;button class="button positive" type="submit"&gt; &lt;img src="like.png" alt=""&gt; Register &lt;/button&gt;  
                    &lt;/fieldset&gt;  
                &lt;/form&gt;  
            &lt;div class="success" style="display: none;"&gt; You are now a registered user!&lt;/div&gt;  
            &lt;/div&gt;';   
?&gt;
</code></pre>

<p>and in my <strong>header.php</strong> I have a function called formValidating</p>

<pre><code>&lt;!DOCTYPE HTML&gt;
&lt;head&gt;
        &lt;title&gt; ShareLink &lt;/title&gt;
        &lt;link rel="stylesheet" href="style.css" type="text/css"&gt;

        &lt;script src="jquery-1.6.4.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
        &lt;script type="text/javascript" src="script.js"&gt;&lt;/script&gt;

        &lt;!-- Back to Top easing jQuery --&gt;
        &lt;link rel="stylesheet" type="text/css" media="screen,projection" href="css/ui.totop.css" /&gt;

        &lt;!-- jquery --&gt; 
        &lt;script src="js/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
        &lt;!-- easing plugin ( optional ) --&gt;
        &lt;script src="js/easing.js" type="text/javascript"&gt;&lt;/script&gt;
        &lt;!-- UItoTop plugin --&gt;
        &lt;script src="js/jquery.ui.totop.js" type="text/javascript"&gt;&lt;/script&gt;

        &lt;!-- For the form submit --&gt;

        &lt;script src="addMember.js" type="text/javascript"&gt;&lt;/script&gt;


        &lt;script type="text/javascript"&gt;
                $(document).ready(function() {
                        /*
                        var defaults = {
                                containerID: 'moccaUItoTop', // fading element id
                                containerHoverClass: 'moccaUIhover', // fading element hover class
                                scrollSpeed: 1200,
                                easingType: 'linear' 
                        };
                        */

                        $().UItoTop({ easingType: 'easeOutQuart' });

                });
        &lt;/script&gt;
        &lt;script type="text/javascript"&gt;

            /////////////////////////////////////////////////////////////
            ////////////////////// FORM VALIDATION //////////////////////
            /////////////////////////////////////////////////////////////

            function formValidating(){
                //username variables
                var username = document.getElementById["user_name"].value;
                //email variables
                var email = document.getElementById["user_email"].value;
                var atpos = email.indexOf("@");
                var dotpos = email.lastIndexOf(".");
                //password variables
                var password = document.getElementById["user_pass"].value;
                var password2 = document.getElementById["user_pass_check"].value;

                //username validation
                if (username == null || username == "")
                {
                     alert("Please enter your username");
                     return false;
                }

                //email validation
                else if (atpos&lt;1 || dotpos&lt;atpos+2 || dotpos+2&gt;=email.length){
                     alert("Please enter a valid email address");
                     return false;
                }

                //password validation
                else if (password == null || password == "")
                {
                     alert("Please enter your password");
                     return false;
                }

                else if (password != password2){
                     alert("Please make sure that your two passwords match")
                     return false;
                }
        }


        &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;&lt;&gt;&lt;/h1&gt;
        &lt;div id="wrapper"&gt;
        &lt;div id="menu"&gt;
                &lt;a class="item" href="/index.php"&gt;Home&lt;/a&gt; -
                &lt;a class="item" href="/create_topic.php"&gt;Create a topic&lt;/a&gt; -
                &lt;a class="item" href="/create_cat.php"&gt;Create a category&lt;/a&gt; - 
                &lt;a class="item" href="/members.php"&gt; Members &lt;/a&gt; - 
                &lt;a class="item" href="/search_form.php"&gt; Search &lt;/a&gt; - 
                &lt;a class="item" href="/profile.php"&gt; Profile &lt;/a&gt;

                &lt;div id="userbar"&gt;
                &lt;?php
                if($_SESSION['signed_in'])
                {
                        echo 'Welcome &lt;b&gt;' . htmlentities($_SESSION['user_name']) . '!&lt;/b&gt;  &lt;a class="item" href="signout.php"&gt;Log out&lt;/a&gt;';
                }
                else
                {
                        echo '&lt;a class="item" href="signin.php"&gt;Log in&lt;/a&gt; or &lt;a class="item" href="signup_2.php"&gt;Register&lt;/a&gt;';
                }
                ?&gt;&lt;/div&gt;
        &lt;/div&gt;
                &lt;div id="content"&gt;
</code></pre>

<p>How can I call this fomValidation function? Please help!!</p>

<p>Thank you!! :)</p>
