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

2
  • 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. Commented Jul 10, 2016 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. Commented Jul 10, 2016 at 23:57

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

5 Comments

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
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.
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?
Alex, I think I am using only the jquery.history.js from the bundled-compressed folder.
Thank you DotNetNuclear I will give this a run for it's money. Best Alex

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.