using input type of 'image' instead of 'button' to fire js popup gives a different outcome
I have a page with a list of members created using databaridge and I have a button on each table row which loads a popup window of a members mini biography.
when the button is clicked, a hidden field in the form is updated with the member id and this is used as the get parameter in my popup form.
the button code is as follows...
<input type="button" class="formButton ResultsPageButton unstyled DetailButton" value="" onclick="document.getElementById('WADARecordID').value=<?php echo($row_WADAtblmember['MemberID']); ?>;document.getElementById('WADAMemberName').value='<?php echo($row_WADAtblmember['MemberFirstName']." ".$row_WADAtblmember['MemberLastName'] ); ?>';openWindow();" />
I would like to change the code so that the form uses an image input type instead, so I created the following, which calls the same javascript function
<input type="image" src="../../../images/buttons/view_button_grey.png" value="preview" title="View Details" onclick="document.getElementById('WADARecordID').value=<?php echo($row_WADAtblmember['MemberID']); ?>;document.getElementById('WADAMemberName').value='<?php echo($row_WADAtblmember['MemberFirstName']." ".$row_WADAtblmember['MemberLastName'] ); ?>';openWindow();" />
but when I tried this, the popup form opens and closes again, whereas it should stay open modally, (the same function is called)
here is my js function...
function openWindow() {
$.window({
title: "Member Profile - "+document.getElementById('WADAMemberName').value,
url: "/members/member_profile.php?MemberID="+document.getElementById('WADARecordID').value,
width: 320, // window width
height: 600, // window height
draggable: false,
resizable: false,
maximizable: false,
minimizable: false,
showModal: true
});
}