perform works before connect to database
<p>i am designing a register form for a site.in this form in html forms we have to password type
and a submit button.</p>

<pre><code>&lt;form action="index1.php" method="post"&gt;
&lt;b&gt;pass:&lt;/b&gt; &lt;input type="password" name="pass" size="25"/&gt;
&lt;b&gt;pass:&lt;/b&gt; &lt;input type="password" name="cpass" size="25"/&gt;
&lt;input type="submit" name ="submit" value="comfirm"&gt;
</code></pre>

<p>on of them are for pass and second for confirm password and a button for submit.</p>

<p>user must fill both of pass and cpass fields until program can store in database </p>

<p>i want that when user click on submit button (for speed up my program) my program check that if two fields are filled are no.if they have filled connect to database and store them into database or if no show a alert to user and doesn't connect to database.
my database codes are in index1.php.</p>

<p>if it possible i check them with javascript functions with onclick in submit?
(i could retrieve form values into a javascript functions and checked them but could not stop program and so it go to index1.php and connect to database that i don't need)</p>

<p>if yes how?
if no how can i do that.</p>

<p>if it possible in javascript me go to a particular page in php for example 5.php?</p>
