Kentico and add Form that posts to external source - forms

I want to create a Salesforce Web to Case from on my Kentico Site.
I have a template built and am inheriting the from that.
I create a new page and then add my form code to the Page Tab > Source and Save.
When I load the page on my site, the form is displayed, but when I hit submit, the form does not do the post action.
How do I accomplish this?
TIA, Jason

Since Kentico is built on web forms, each page's content is wrapped inside a form tag.
Adding your markup (including a form tag) in the middle of a Kentico page results in a nested form, which is invalid.
The quickest way to make this work is probably:
Create a basic HTML document with your markup, and put it on a new page in a "Custom Response" web part. https://www.screencast.com/t/PuwwnFTGGpAJ
Then display that new document in an iframe on your current page.
If that won't work, you can put your form markup in a div hidden by CSS. Then use javascript to move the div to a location after the page's main form tag. You can then use CSS to absolutely position the form on the page.
I hope this is helpful, good luck.

Related

Load a different form on different pages using the same page template

Kentico 12, not MVC:
I have a page template that is used on several pages. On some of those pages I want to display a form. (a biz form from the Forms application) I don't necessarily want the same form on each of those pages. I need a way to specify which form to display. I expect I could create a field in the page type to specify the form name, but it would be nicer to be able to have designers add a page with the form on it, and have a repeater display that page in a webpartzone on the aforementioned page template. I'm not sure how to do this, though. Anyone have an example or suggestions?
If you’re using portal engine, then you should easily be able to add an editor zone to your template. Content editors can then add the online form widget to individual pages. The widgets work at page level rather than template level, so should give the control you
The page from the docs will show how to setup an editor zone:
https://docs.kentico.com/k12/developing-websites/preparing-widgets-for-users/setting-up-widget-zones-on-pages
In addition to adding a widget zone, you can simply add an editable text webpart to the template and in the WYSIWYG editor you can click on the BizForm icon to insert that widget there. This doesn't require you to change the page template to a widget zone template.

How to manipulate the meta area of the HTML dom with Scala-JS for a single page application

General Scala-JS page building advice needed. Most of the examples seem to be of the pattern where the main into which your single page application will go is between the tags in a landing page html file. How do you handle the need to insert something in the meta area of the dom? Do I need to render my landing page dynamically from the server to accomplish this? My specific need is to inject a script tag into the meta area of an already defined static html page. I'm using scalajs-react.
Generally you will want a server-rendered "root page" for the SPA. This allows you to dynamically compute proper cache busting file names for your script and stylesheet tags and to easily manage the cache expiration of the root page. Also, for proper html5 push state support you'll want to serve that page at every URL, which is easily done with a server side route.

Wicket: Loosing form input on page re-render

I have pages with forms. Everything is working fine. Except, that there is a link (language selecter) on the pages. The requirement is, that when the user has already input in the form fields and than (without submitting the form) is clicking the link, all input should be retained.
If the link would be part of the form, this could easily archived via a SubmitLink and submitLink.setDefaultFormProcessing(false);
Unfortunately, this link has no knowledge of the form(s) on this page.
Any pointers if this is solvable? Of course, validation should not be triggered.
client-side JavaScript solution
wrap complete page content in a form
(yes, Wicket allows nesting of forms) and use an SubmitLink with
defaultFormProcessing=false
add an AjaxFormComponentUpdatingBehavior
to all your form fields, so the input is always sent to the server

How do I make a link that pre-fills a form checkbox?

I have a page called contact.htm with a working form. One of the checkbox fields on the form is named Garden (so either it is checked or not when using the form).
I have another page that I want to link to my form page, so that if a user clicks a particular link, they are sent to the form page and the field Garden is pre-clicked.
I have not been able to do this though I have tried several methods...such as:
a href="contact.htm?checkbox=Garden,on" or
a href="contact.htm?checkbox=Garden,checked" or
a href="contact.htm?input type="checkbox" name="Garden" value="checked", and some others.
I would appreciate any help.
You'll need to use JavaScript on the target webpage to process the argument and fill the values in. There is no automatic way of doing this just by URL.
This link shows how to retrieve URL arguments from JavaScript. From there, it's a matter of using standard JavaScript or JQuery to fill the values in.

typo3: is there a way to see the pages and its html templates in one place?

in typo3 admin site, I am using TemplaVoilĂ  to make html templates. I have many pages in my site, so I wonder if there is a way that I can check which page is using which html template in one overall page, instead of checking it one by one, something like:
contact page: home.html
employer page: employer.html
...
You can use a hook to add this information in the TemplaVoila s module.