After hitting submit on my Online Form I want the Form to dissapear and make my Display MediaGallery

Ameya Kulkarni asked on August 17, 2017 21:05

After hitting submit on my Online Form I want the Form to disappear and make my Display MediaGallery webpart visible. How do I achieve that ?

Recent Answers


Peter Mogilnitski answered on August 17, 2017 21:26 (last edited on August 17, 2017 21:53)

You can probably create a custom macro method where you can return System.Web.UI.Page.IsPostBack property and set visibility for media gallery web part based using this custom macro method, but you have to keep in mind that a postback may occur, but for example some fields validation can fail. As far as I understand you want to show media gallery only if form submission was successful. Probably 2 page solution will be better here. 1st page with a biz form and 2nd page with a media gallery and in the biz form settings you can specify "After the form is submitted:" redirect to page (2) with gallery. Both pages can use the same master.

1 votesVote for this answer Mark as a Correct answer

Ameya Kulkarni answered on August 17, 2017 21:59

Is it possible to Show or Hide a web part using Jquery/Javascript in Kentico ? If that is so, I can write a Jquery function tied to the Submit click event of my form.

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on August 17, 2017 22:37

you can show/hide web part on the server side using macros/k#. you can show/hide an element of document(DOM) on a client side using jquery/javascript, but I would not do it on the client side on onsubmit event.
I would add my javascript like in the example below: Image Text If your form correctly submitted the display text will be rendered (you ll see the alert). instead of alert you can do $('#divMedia').toggle() assuming that your media library is wrapped into <div id='divMedia' style='display:none'>...</div>

1 votesVote for this answer Mark as a Correct answer

Christopher Oakley answered on July 2, 2018 23:29

@Peter Mogilnitski

Any chance you still have a picture of that example handy? Or could explain what it was.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.