<div>I am running into a brand new issue today that I can't, for the life of me, figure out. I wrote a standard page to insert data into a MySQL table using Z SQL methods from a form like I always have but for some strange reason it's running the same query twice, thus adding a duplicate entry. </div>
<div> </div>
<div>I have confined the original code in it's own document, checked, double checked, and still no avail. Here's the code for the page: </div>
<div> </div>
<div><dtml-var frame_header></div>
<div><dtml-if addnewstatus><br> <dtml-try><br> <dtml-call "RootSQLMethods.admin.Status_Add(_.None,_)"><br> <dtml-call "RESPONSE.redirect(BASE2+'/statuses')"><br>
<dtml-except><br> <p>Error while submitting! Status not added.</p><br> <br>Error type: <dtml-var error_type><br> <br>Error value: <dtml-var error_value><br> </dtml-try><br>
</dtml-if></div>
<div><form action="&dtml-URL;" method="post"><br> <table class="tborder" align="center" width="30%" cellspacing="0" ><br> <tr><td class="tcat" align="center" colspan="2" style="font-size: 12pt;">Add New Status</td></tr><br>
<tr><td width="35%" align="right"><b>Name:</b></td><td width="65%"><input type="text" name="name_add" size=15></td></tr><br>
<tr><td width="35%" align="right" valign="top"><b>Description:</b></td><td width="65%"><textarea name="description_add" cols=25 rows=4></textarea></td></tr><br>
<tr><td width="35%" align="right"><b>Sort:</b></td><td width="65%"><input type="text" name="sort_add" value="5" size=1></td></tr><br>
<tr><td align="center" colspan="2"><hr></td></tr><br> <tr><br> <td><input type="hidden" name="addnewstatus" value="1"></td><br>
<td><br> <button class="button" onclick="this.form.submit()">Add Status</button>&nbsp;&nbsp;<br> <button class="button" onclick="window.location = '<dtml-var BASE2>/statuses'; return false;">Cancel</button><br>
</td><br> </tr><br> </table><br></form></div>
<div><dtml-var frame_footer></div>
<div> </div>
<div>I can run the SQL Method by itself and it works just fine (only inserting it once) but when run as a separate page it adds the two. </div>
<div> </div>
<div>Any assistance is appreciated</div>