Jump to content

Delete button help problem?


silver_fox4me

Recommended Posts

HI, i'm doing a php project and have a page where the admin can delete the pupil. I've got a button that is a graphic that deletes the selected checkbox when you hit the button. What i'm trying to do is to get a javascript confirmation up is yes/no. All i've been able to do so far is the same but with a basic submit button, not the graphic. Any ideas..... much appreciated

 

 

following code works- but just with normal boring submit, code for graphic is below this

<form name='myform' action='delete_selected_option.php' method='POST'>

 

</form>

**************

 

function confSubmit(form) {

if (confirm("please confirm you wish to delele these records")) {

form.submit();

}

 

else {

alert("records were not deleted");

 

}

}

*******************************************

 

button i want the above to have a similar affect. (currently the check comes up with same code above but with the graphic input, but when i hit cancel it still submits the form

 

<input type='image' src='../Graphics/delete_record.gif' onClick='confSubmit(this.form);' value='Submit Form' align='right' alt='click to delete record'/>

Link to comment
Share on other sites

try this...u should return values like this...

 

function confSubmit(form) {

if (confirm("please confirm you wish to delele these records")) {

form.submit();

}

 

else {

alert("records were not deleted");

 

}return false;

}

 

 

<input type='image' src="" onClick=' return confSubmit(this.form);' value='Submit Form' align='right' alt='click to delete record'/>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.