djh101
07-03-2010, 02:23 AM
<fieldset class="submit">
<?php if ($site_exist >= 1){
echo "<input type=\"submit\" name=\"submit\" value=\"Update\">";
} else { echo "<input type=\"submit\" name=\"submit\" value=\"Submit\">";
} ?>
<!-- The next line is the part in question -->
<input type="button" name="delete" value="Delete"
onClick="return confirmSubmit()">
</fieldset>
</form>
<script type="text/javascript"><!--
function confirmSubmit(){
var agree=confirm("Are you want to delete this site from our index?");
if (agree) return true ;
else return false ; } // -->
</script>
Both the submit and the delete button are inside of a form. The submit button submits the form. The delete button is almost the same as the submit button, except instead of the form data I want it to post a separate, single variable (named delete or siteDelete and its value being true). I don't want to use javascript, the js code is only their to add a confirmation button.
<?php if ($site_exist >= 1){
echo "<input type=\"submit\" name=\"submit\" value=\"Update\">";
} else { echo "<input type=\"submit\" name=\"submit\" value=\"Submit\">";
} ?>
<!-- The next line is the part in question -->
<input type="button" name="delete" value="Delete"
onClick="return confirmSubmit()">
</fieldset>
</form>
<script type="text/javascript"><!--
function confirmSubmit(){
var agree=confirm("Are you want to delete this site from our index?");
if (agree) return true ;
else return false ; } // -->
</script>
Both the submit and the delete button are inside of a form. The submit button submits the form. The delete button is almost the same as the submit button, except instead of the form data I want it to post a separate, single variable (named delete or siteDelete and its value being true). I don't want to use javascript, the js code is only their to add a confirmation button.