•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 397,598 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,848 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1620 | Replies: 18 | Solved
Hi there
I have a form that I'm trying to submit but it just doesn't want to play nice.
The form i have has 2 submit buttons. One processes php code that updates info in a DB and the other deletes the info in the DB. The problem is that I have a popup asking for confirmation on the deleting and when I click ok nothing happens. All I need to know is how to submit my form using javascript so that it processes the PHP code to delete the DB entry.
form tag and delete button
confirmation popup
Code that deletes DB entry
I have a form that I'm trying to submit but it just doesn't want to play nice.
The form i have has 2 submit buttons. One processes php code that updates info in a DB and the other deletes the info in the DB. The problem is that I have a popup asking for confirmation on the deleting and when I click ok nothing happens. All I need to know is how to submit my form using javascript so that it processes the PHP code to delete the DB entry.
form tag and delete button
<form name="formname" id="formname" method="post" action="<?= $_SERVER['PHP_SELF']?>" onSubmit="return checkWholeForm(this);"> <input onclick=\"confDelete()\" type="submit" name="delete" value="Delete">
confirmation popup
javascript Syntax (Toggle Plain Text)
<script type="text/javascript"> <!-- function confDelete() { var answer = confirm("Msg") if (answer==true){ document.formname.submit(); return true; } } //--> </script>
Code that deletes DB entry
php Syntax (Toggle Plain Text)
if (isset($_POST['formname'])){ \\ code goes here }
This user has a spatula. We don't know why, but we are afraid.
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
&bul


