I have a page which lists visitors for an event. In case the user doesnt see the RSVP for their, I want to present a link which sends the user to the Add/New form for the visitors table... and I want to do it as a popup/dialogue.
What I have at the moment is a CEWP with the following (copied from Designer):
<Content xmlns="http://schemas.microsoft.com/WebPart/v2/ContentEditor">
<![CDATA
[Dont see the person you were looking for?
<a href="javascript:displayLayover("../Lists/VisitRequest_PeopleInfo/NewVisitor.aspx?EventID=@EventID&IsDlg=1")">
Add them to the visit request
</a>
]
]>
</Content>
The page this code is on uses a URL parameter ("ID") to know which event the user wants to view visitors for. How can I use this URL parameter and pass it into the hyperlink? Right now the placeholder in the URL is @EventID.
It is important to get this variable working to ensure the visitor gets added to the correct event (the new visitor page uses this parameter to set the event ID).
The JavaScript function (displayLayover) I am using to get the Dialogue Box is:
<script type="text/javascript">
function displayLayover(url) {
var options = SP.UI.$create_DialogOptions();
options.url = url;
options.dialogReturnValueCallback = Function.createDelegate(
null, null);
SP.UI.ModalDialog.showModalDialog(options);
}
</script>
Thanks!!
../Lists/VisitRequest_PeopleInfo/NewVisitor.aspx?ID=1&EventId=@EventntID. Am I right?