I have a button in my form which will redirect the user to another page, but before this happens I added a 'pop-up confirm'.
If I use a regular image it works fine, but if I use this button the pop-up comes up and even though i select 'cancel' in the pop up then the user is re-directed, and they shouldn't.
What is wrong with this code ?
<input name="BtnArchive" type="button" class="bodytext" id="Btncancel2" onClick="GP_popupConfirmMsg('Please confirm you wish to archive this contact.\r\rNote that all of this contact\'s cases will also be archived automatically.');self.location='ArchiveContactandCases.asp?NewUserid=<%=(ContactDetails.Fields.Item("UserId").Value)%>';return document.MM_returnValue" value=" Archive Contact ">
You do this nClick="GP_popupConfirmMsg
which is like this:
Open in new window
As you can see here, it doesn't matter what happens in the GP_popupConfirmMsg, you always send the webpage to the Archivecontact... page in the very next line.From google, I think the function you are using is like this:
Open in new window
It is in this function that you should put the destination... (and any other code that should happen based on the selection.