Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Biz Form buttons, validation View modes: 
User avatar
Member
Member
ryans-tushaus - 6/13/2013 6:09:25 PM
   
Biz Form buttons, validation
I would like to have 2 buttons on my biz form; one button would allow the user to save a partially completed form so it would not validate required fields. The second button would validate and save as usual.

1. How can I hide the default submit button?
2. How can I disable validation for the first button? The CausesValidation="False" seems to have no effect.

User avatar
Member
Member
ryans-tushaus - 6/14/2013 6:13:37 AM
   
RE:Biz Form buttons, validation
I've figured it out:

I was using the correct code to hide the submit button but the code cannot be put in SetupControl(). I moved the code to viewBiz_OnAfterDataLoad. viewBiz.BasicForm.SubmitButton.Visible = false;

I disabled the required field checks on all fields except for an e-mail address field with the following code:
    protected void btnSaveFinishLater_Click(object sender, EventArgs e)
{
foreach (DictionaryEntry entry in viewBiz.BasicForm.FieldControls)
{
if (entry.Key.ToString() != "EmailAddress")
{
FormEngineUserControl fectrl = (FormEngineUserControl)entry.Value;
fectrl.CheckFieldEmptiness = false;
}
}

viewBiz.BasicForm.SaveData("");
}

User avatar
Member
Member
kentico_sandroj - 6/14/2013 9:38:20 PM
   
RE:Biz Form buttons, validation
Hello,

Thank you for sharing the solution with us. I would just like to point out that you can change the default submit button on the General tab for a specific Form in CMS Desk > Tools. You can either specify different text or add an image. Perhaps you have a reason for doing it in code but this is just in case other customers need to make a simple change.

Regards,
Sandro

User avatar
Member
Member
ryans-tushaus - 6/15/2013 5:08:35 AM
   
RE:Biz Form buttons, validation
I needed to have 2 buttons appearing side by side. If I had kept the default submit button visible and just added a second button, it would have appeared below the default submit button.