1

I use the DNN CMS platform and am utilizing a module called ActionForm to create forms from a company called DNNSharp.

There is an option in this module to display a form in a popup however I cannot pass a query string to the popup URL using this method.

The HTML looks like this

<a href="javascript: showFormPopup1163();">Link Title</a>

Now when I add ?mystring=[mytoken] to the end of the href attribute it stops the link from working.

From what I've read I think it is possible to add that query string to the popup URL using JavaScript.

I've read the following topic but don't know if that is the proper solution for my situation or how I would implement it?

Add Query-String parameter to static link on click

Would I just add that code into a tags into my html code?

I really appreciate any insight anyone could pass my way. Many Thanks, Alex

Community
  • 1
  • 1
UserSN
  • 953
  • 1
  • 11
  • 33
  • 1
    Your anchor executes a javascript function named `showFormPopup1163`, adding anything to that won't work, you have to figure out what the function does, and how it redirects, and add the querystring to that. – adeneo Jul 10 '16 at 14:07
  • @adeneo thanks for your input, I do not have access to the source of the module i'm using to create forms. I was looking for an external solution that I could possibly inject or implement otherwise. – UserSN Jul 10 '16 at 23:57

1 Answers1

1

I do this using History.js

Not sure if ActionForms has a setting for allowing you to include external scripts, but if you can register history.js, you can do something like this:

var qsParams = '?mystring=[mytoken]';
var data = '{ mystring: [mytoken] }';
var title = 'Form with token: [mytoken]';
History.pushState(data, title, qsParams);

This will change the url without re-posting the page and will also allow the browser back button to return to the previous url without the querystring change.

Fix It Scotty
  • 2,852
  • 11
  • 12
  • Thanks for your answer, I will try and find some videos about the History.js and how to install, off the top of my head i'm assuming I would add the register code into my acsx skin file? Thanks – UserSN Jul 10 '16 at 23:58
  • 1
    Alex, you can register it in your skin page or you can add a script register tag in the module's Module Settings > Advanced Settings > Header field. – Fix It Scotty Jul 11 '16 at 14:26
  • i've downloaded the history.js files from github and there is a folder called scripts that contains bundled, bundled-uncrompressed, compressed & uncompressed. Which should be used & inside any of these HTML5 or HTML4+5? (im guessing HTML5) dojo.history.js, exs.history.js, etc... do all 7 of these files need to be registered? – UserSN Jul 12 '16 at 01:22
  • 1
    Alex, I think I am using only the jquery.history.js from the bundled-compressed folder. – Fix It Scotty Jul 12 '16 at 12:40
  • Thank you DotNetNuclear I will give this a run for it's money. Best Alex – UserSN Jul 13 '16 at 17:39