Hi all,

i have recently come across a problem with my code while trying to use JavaScript with a form, simply when i use the onclick function my form will not submit, what i want is a confirmation dialogue to pop up and if the user clicks yes the form submits, if they click no nothing will happen. This needs to happen using POST since my code deletes an entry from the database.

heres the code im using in the form.

Code:
            echo '
            <form action="editLinks.php" method="post">
              <input type="hidden" name="edit" value="true" />
              <input type=hidden name=delete value=true />';
              
              echo "
              {$row['name']}
              <input type=\"hidden\" name=\"deleteid\" value=\"{$row['id']}\" />
        </td>
        <td>
          <input type=\"submit\" name=\"Delete\" value=\"Delete\" onclick=\"javascript: if(confirm('Are you sure you want to delete?')) this.form.submit();\" />
	        </form>

i already posted this in the PHP section by mistake, would be appreciated if a mod could delete it for me.