Dynamic RedirectToURL with InputField | WordPress.org

[ad_1]

Hi,

I want to use a CFF to show a certain picture after typing a certain picture ID. The user shall type the ID of the picture he wants (“ABC12345”) and after pressing a button he sees the picture with the URL “https://domain.com/wp-content/upload/eventid/ABC12345.jpg”

I have the input field 1 for the ID, a calculated field 2 in which the URL is generated with field 2 set equation: ”https://domain.com/wp-content/upload/eventid/” + fieldname1 + “.jpg” and that looks fine in the calculated field.

And a button (calculate) with the onclick event: redirectToURL(fieldname2).

But this doesn’t work. Nothing happens. I guess I made a stupid mistake and I tried a lot of variations but nothing does work. It does work when I take the complete path (redirectToURL(”https://domain.com/wp-content/upload/eventid/ABC12345.jpg&#8221😉 for the onclick event.

Perhaps there is somebody who can help me? Thanks in advance

  • This topic was modified 18 minutes ago by Andreas.
  • This topic was modified 16 minutes ago by Andreas.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer