Evening everyone,
I have a quick question that I am hoping is something that is possible.
I have a page that I use for deleting records from a database.
I have a delete button which will do what I need it to. I am wanting to have a div slide down when the delete button is clicked as a confirmation of what is going to be deleted.
I can do the slide down just fine and adding the text.
This is what I have so far:
$('#delete').on('click', function()
{
$('#info').slideDown();
$('#info').html('Really delete <?php echo $aid; ?>?');
$('<br/><br/><input type="button" value="Sure" id="sure">').appendTo('#info');
});
$('#sure').on('click', function(e)
{
e.stopPropagation();
alert('Goodbye <?php echo $aid; ?>?');
});
I am wanting the button with the id of sure to trigger an event when clicked. I am able to show the button, and click it but it isn't triggering anything when clicked on.
I added the stop propagation from looking at this question
I have done a quick Google and nothing seems to fit what I need it to do. Is this something really simple that I am missing? Or is it something that can't be done?
Also, this is the basic gist of my form:
<form name="..." action="..." method="...">
// form content
<input name="delete" type="button" id="delete" value="Delete" tabindex="23"/>
<div id="info"></div>
</form>
Here is a fiddle for it
TIA