Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How to create cancel or reset button in Bizform View modes: 
User avatar
Member
Member
sansugoi_sayounara-hotmail - 12/20/2011 11:29:19 PM
   
How to create cancel or reset button in Bizform
Hi ,

How can we create "Cancel" or "Reset" button in Biz forms. please guide me as I have to add these buttons in my website..

User avatar
Member
Member
kentico_michal - 12/21/2011 9:25:51 AM
   
RE:How to create cancel or reset button in Bizform
Hello,

You can add a new button to the BizForm web part (~\CMSWebParts\BizForms\bizform.ascx.cs):

<asp:Button runat="server" ID="asdasd" OnClick="OnClick" />


and use the following code that should reset all BizForm's fieds in its OnClick handler:

    protected void OnClick(object sender, EventArgs e)
{
foreach (DictionaryEntry field in viewBiz.BasicForm.FieldEditingControls)
{
if (field.Value is EditingFormControl)
{
((EditingFormControl)field.Value as EditingFormControl).Value = null;
}
}
}


Best regards,
Michal Legen

User avatar
Member
Member
robert-tailor.co - 5/31/2012 6:32:00 PM
   
RE:How to create cancel or reset button in Bizform
So you're saying I have to customize a core file of Kentico (that will affect every single BizForm in the CMS) to enable support for a button that is considered a basic standard minimum for just about every single online web form?

Why not simply provide a checkbox to 'Show Reset Button?' when creating a BizForm? Or maybe even allow users to add a reset button in the 'Custom Form Layout' page? Currently, if I were to add a reset button to the 'Custom Form Layout' page using the standard:

<input type="reset" value="Reset" />

The form fails to render at all.

What is the logic behind this?

User avatar
Member
Member
robert-tailor.co - 5/31/2012 6:43:37 PM
   
RE:How to create cancel or reset button in Bizform
robert-tailor.co wrote: Currently, if I were to add a reset button to the 'Custom Form Layout' page using the standard:

<input type="reset" value="Reset" />

The form fails to render at all.


Correction. It does work. Kentico was caching the wrong page and ended up reloading the wrong page whenever I tried testing my changes.

User avatar
Member
Member
kentico_michal - 6/1/2012 2:26:51 AM
   
RE:How to create cancel or reset button in Bizform
Hi,

Thank you for sharing your solution. I think the reason for not providing the reset button is that you have the alternative form under your control, so you can place the reset button where you need, as editors might want to display the button on different places for different forms.

However, you can suggest this feature for the future release: Kentico User Voice.

Best regards,
Michal Legen