Form is not submitting in ajax returned html data from php
<p>There are three files 
1.street_master.php    2.street.php   3.streetdelete.php</p>

<p>street_master.php has form for adding new street(streetname,streetcode) when submit is pressed using ajax call new street is added and and the street list from the database are printed in table format( with individual delete option delete is done by streetdelete.php file  ) on the same page that is  street_master.php .but delete option is not working. actually form is not submitting which redirect to streetdelete.php</p>

<p>streetmaster.php</p>

<pre><code>&lt;html&gt;
    &lt;?php include 'conf.php'; ?&gt;
    &lt;head&gt;
        &lt;link rel="stylesheet" href="css/bootstrap.min.css"&gt;
        &lt;script src="jquery-1.12.0.min.js"&gt;&lt;/script&gt;
        &lt;script src="js/bootstrap.min.js"&gt;&lt;/script&gt;
        &lt;script&gt;
            function showUser()
            {

                var n1=document.getElementById('scode').value;
                var n2=document.getElementById('sname').value;
                var n3=document.getElementById('desc').value;
                var n4=document.getElementById('ward').value;

                if (n1 == null || n1 == "" )
                {
                   alert('fill street code ');
                }
                else if( n2 == null || n2 == "" ) {
                alert('fill street name');
                }
                else
                {
                xmlhttp = new XMLHttpRequest();
                xmlhttp.onreadystatechange = function()
                {
                    if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200)
                    {
                        document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
                    }
                }

                var q="?v1="+n1;
                q+="&amp;v2="+n2;
                q+="&amp;v3="+n3;
                q+="&amp;v4="+n4;



                xmlhttp.open("GET","street.php"+q,true);
                xmlhttp.send();
                }
            }
        &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;center&gt;
            &lt;h2&gt;Street Master&lt;/H2&gt;
        &lt;/CENTER&gt;
        &lt;form class="form-horizontal" role="form"&gt;
            &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-2"&gt;Street code &lt;/label&gt;
                &lt;div class="col-sm-1"&gt;
                    &lt;input type="number" class="form-control" name="scode" id="scode" required&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-2"&gt;  Street name&lt;/label&gt;
                &lt;div class="col-sm-2"&gt; &lt;input type="text" class="form-control" name="sname" id="sname" required&gt; &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-2"&gt; Description&lt;/label&gt;
                &lt;div class="col-sm-2"&gt; &lt;input type="text" class="form-control" name="desc" id="desc" &gt; &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
                &lt;label class="control-label col-sm-2" for="ward num"&gt; Ward No &lt;/label&gt;
                &lt;div class="col-sm-2"&gt;
                    &lt;select name="ward" id="ward" class="form-control"&gt;
                        &lt;option value=""&gt;chose the ward&lt;/option&gt;
                        &lt;?php
                            $s="select  WardNo from ward";
                            $result=$con-&gt;query($s);

                            while($row = $result-&gt;fetch_assoc())
                            {
                                echo  "&lt;option value='$row[WardNo]'&gt; ward $row[WardNo]&lt;/option&gt;";
                            }
                            ?&gt;
                    &lt;/select&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="form-group"&gt;
                &lt;div class="col-sm-2"&gt; &lt;/div&gt;
                &lt;div class="col-sm-2"&gt; &lt;input type="button"  class="form-control" value="submit" onClick="showUser()"&gt; &lt;/div&gt;
            &lt;/div&gt;
        &lt;/form&gt;
        &lt;div id="txtHint"&gt;&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>street.php</p>

<pre><code>&lt;?php

    $q =$_GET['v1'];
    $q1 =$_GET['v2'];
    $q2 =$_GET['v3'];
    $q3 =$_GET['v4'];

    /
     include 'conf.php'; 

    if($con)
    {
       $sql="insert into areacodemaster values('$q','$q1','$q3')";
        $con-&gt;query($sql);
        $s="select * from areacodemaster";
        $result=$con-&gt;query($s);
        echo "
        &lt;head&gt;
        &lt;link rel='stylesheet' href='scroll.css'&gt;
        &lt;script src='scroll.js'&gt;&lt;/script&gt;
        &lt;/head&gt;
        &lt;body&gt;&lt;center&gt;
        &lt;table class='scroll'&gt;
        &lt;thead&gt;
        &lt;tr&gt;
        &lt;th&gt;Street_code&lt;/th&gt;
        &lt;th width='70%'&gt;Street_Name&lt;/th&gt;
        &lt;th&gt;Ward_Number&lt;/th&gt;
        &lt;th&gt;delete&lt;/th&gt;
        &lt;/tr&gt;
        &lt;/thead&gt; ";
        echo "
        &lt;tbody&gt; ";


        while($row = $result-&gt;fetch_assoc())
        {
            echo "
            &lt;tr&gt;
            &lt;form action='streetdelete.php' method='post'&gt;
            &lt;td&gt;".$row['Areacode']."&lt;/td&gt;
            &lt;td&gt;".$row['Areaname']."&lt;/td&gt;
            &lt;td&gt;".$row['WardNo']."&lt;/td&gt;
            &lt;td&gt;&lt;input type='hidden' name='ac' value='$row[Areacode]'&gt;
            &lt;td&gt;&lt;input type='submit' value='Delete'&gt;&lt;/a&gt;&lt;/td&gt;
            &lt;/form&gt;
            &lt;/tr&gt;";
        }

        echo "

        &lt;/tbody&gt;
        &lt;/table&gt;&lt;/center&gt;
        &lt;/body&gt; ";


    }


    ?&gt;
</code></pre>

<p>streetdelete.php</p>

<pre><code>&lt;?php
$g=$_POST['ac'];
include 'conf.php';
            $sq="delete from areacodemaster where Areacode='$g'";
            $con-&gt;query($sq);
             echo "&lt;script type='text/javascript'&gt;alert('Deleted');         &lt;/script&gt;";
?&gt;
</code></pre>

<p>but if we run street.php alone form is submitting to streetdelete.php</p>