Es gibt irgendwas zwischen Millionen und Milliarden Beispiele im Netz. Wie lautet Dein Problem?
Folgendermaßen:
Das Problem war, dass man bei Typ Input-Submit das Absenden der Informationen wohl nicht verhindern kann
D.h. bei folgendem Code wird das Formular abgeschickt, egal, ob ich bei dem confirm()-Aufruf "ok" oder "abbrechen" wähle.
---------
...
function check(status,id)
{
msg = "";
if( status == 'deceased' ) msg = "Do you really want to mark this stallion 'deceased'?";
if( status == 'sold' ) msg = "Do you really want to mark this stallion 'sold'?";
if( confirm( msg ) )
{
document.forms[id].submit();
}
}
...
<input type="submit" name="status" value="deceased" onClick="check('deceased',1)" />
<input type="submit" name="status" value="sold" onClick="check('sold',1)" />
...
---------
Dazu hab ich kein Beispiel im Netz gefunden.
Greets und Danke