Below a solution to be worked, but before... a cave, do not lead to bad!
I am outraged that as much as you study, have the ability to create solutions, some prejudiced does not give you the opportunity to act in the area.
I have been trying for more than 13 years (I did not give up, but I do not seek more). Because I have in my wallet, crafts of the manual type,
many or all qualify you as unfit, without even having any idea of your competence.
I am not talking about the author of the question, but about those who take the ready thing. These are the ones that companies invest in. In the opportunists.
Here is an example of how to apply one of the solutions to the case!
PS.: Sorry for the bad "professionalism" of the code.
Follow...
function CONFIRMA(txt, idform, confirmacao, ylegenda, nlegenda){
box = document.getElementById('bloco');
msg = document.getElementById('msg');
bt_y = document.getElementById('ylegenda');
bt_n = document.getElementById('nlegenda');
if(confirmacao==''&&txt!=0){
msg.innerHTML=txt;
bt_y.innerHTML=ylegenda;
bt_n.innerHTML=nlegenda;
box.style.display='block';
return false;
}
if(confirmacao == true){
document.getElementById(idform).submit();
}
box.style.display='none';
}
<div id="bloco" style="display: none;">
<div id="msg"></div>
<a href="javascript:void(0);" onClick="CONFIRMA(0, 'form1', true)"><span id="ylegenda"></span></a> -------------
<a href="javascript:void(0);" onClick="CONFIRMA(0, 'form1', false)"><span id="nlegenda"></span></a>
</div>
<div>
<p> </p>
<form id="form1" name="form1" method="post" onSubmit="return CONFIRMA('Vai fazer cagada?', this.id, false, 'Sim, sou imbecil', 'Puts...')" action="">
<input type="submit" name="Submit" value="Aplicar">
</form>
</div>
Missing only format with css styles.
Good luck!
Thank you for the @Elipe-assunção edition suggestion
– Gugo