Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Removing EditingFormControlNestedControl div from around form controls View modes: 
User avatar
Certified Developer 8
Certified Developer 8
richard - 7/8/2011 9:46:22 PM
   
Removing EditingFormControlNestedControl div from around form controls
Is there any way to remove this container from around the rendered inputs from a form using the API? An override method?

User avatar
Member
Member
kentico_edwardh - 7/9/2011 4:20:29 PM
   
RE:Removing EditingFormControlNestedControl div from around form controls
Hello,

Without having the source code version of Kentico CMS, I do not believe you can remove the div from around the form control. By default, each form control is nested into DIV tag with EditingFormControlNestedControl css class.

This behavior is ensured in ~\CMSFormControls\EditingFormControl.cs file. The Div tag is not part of the form control itself but part of the class which is responsible for adding controls to page in mentioned class. I think that ASP.NET panel is represented as DIV tag in .NET and we are adding the control to this panel.

Regards,
Edward Hillard

User avatar
Member
Member
stevenmc - 7/29/2013 8:55:48 AM
   
RE:Removing EditingFormControlNestedControl div from around form controls
There's an easy way to remove the div tags using jQuery.

Try this, after loading jQuery in the <head> of your document:
<script>
$(document).ready(function(){
$('.EditingFormControlNestedControl').replaceWith($('.EditingFormControlNestedControl').html());
});
</script>

User avatar
Member
Member
Futurecom - 10/18/2013 4:27:08 AM
   
RE:Removing EditingFormControlNestedControl div from around form controls
I tried stevenmc's code, but it didn't work for multiple fields. This is what I ended up going with, which works fine:

$(".EditingFormControlNestedControl").each(function() {
$(this).replaceWith($(this).html());
});