SOLVED

TUTORIAL REQUEST: URL Parameters in visible fields and/or HTML

Go to solution
Justin_Cooperm2
Level 10

Re: TUTORIAL REQUEST: URL Parameters in visible fields and/or HTML

Hey Robb,

I can't go through your whole page, but I tested out this simple example and it works fine:

0EM50000000S5mJ.jpg

Good luck!

Justin
Anonymous
Not applicable

Re: TUTORIAL REQUEST: URL Parameters in visible fields and/or HTML

You added a # to the span IDs, remove that and try.
Anonymous
Not applicable

Re: TUTORIAL REQUEST: URL Parameters in visible fields and/or HTML

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
if (/[?&]CPSRefSiteName=/.test(location.href)){
$("#sitename").text(getUrlVar('CPSRefSiteName'));
} else {
$("#sitename").text('Fallback Text'); }
if (/[?&]CPSRefSiteEmail=/.test(location.href)){
$("#siteemail").text(getUrlVar('CPSRefSiteEmail'));
} else {
jQ("#siteemail").text('Fallback Text'); }
</script>
 
<p>You selected <span id="sitename"></span>. Please click Confirm to send a note to <span id="siteemail">.</p>


Try this exactly.
Robb_Barrett
Marketo Employee

Re: TUTORIAL REQUEST: URL Parameters in visible fields and/or HTML

Sorry to bug you again Justin....

The coode works great, but when I put a form on the page it quits working.  I took the HEAD part and put it on the page headers and it worked fine, then I put the form in and it quit working.
Robb Barrett
Robb_Barrett
Marketo Employee

Re: TUTORIAL REQUEST: URL Parameters in visible fields and/or HTML

Bumping on this.  This works when I put it in as an HTML block but when I put a form on the page as well it doesn't work.  Any thoughts?  Do I need to submit this as a ticket?
Robb Barrett