Custom Script:
$(document).ready(function() {
//Customize these values to personalize your modal popup
var align = 'center';
var top = 100;
var width = 500;
var padding = 10;
var backgroundColor = '#FFFFFF';
var source = 'AttractionDetails.aspx?AttractionID= **RETRIEVE_VALUE_FROM_HIDDEN_FIELD** ';
var borderColor = '#333333';
var borderWeight = 4;
var borderRadius = 5;
var fadeOutTime = 300;
var disableColor = '#666666';
var disableOpacity = 40;
var loadingImage = 'lib/release-0.0.1/loading.gif';
//Initialize the modal popup when clicking on an element with class "modal"
$(".modal").click(function() {
modalPopup(align, top, width, padding, disableColor, disableOpacity, backgroundColor, borderColor, borderWeight, borderRadius, fadeOutTime, source, loadingImage);
});
//Close the popup when the escape key is pressed
$(document).keyup(function(e) {
if (e.keyCode == 27) {
closePopup(fadeOutTime);
}
});
});
LISTVIEW:
<ItemTemplate>
<td id="Td6" runat="server" style="background-color: #FFFFFF; color: #000000; width: 120px;">
<asp:Label ID="AttractionNameLabel" runat="server" Text='<%# Eval("AttractionName") %>' />
<br />
<a class="modal" href="javascript:void(0);"> Modal Pop Up </a>
<asp:HiddenField ID="HiddenField1" runat="server" Value='<%# Eval("AttractionID") %>' />
</td>
</ItemTemplate>
I am looking to extract the value from the HiddenField
of the clicked item [when clicking on the hyperlink "Modal Pop Up"] using JavaScript.
Appreciate your help!