Upload File Form Control table mark up

Sarah Pengelly asked on December 6, 2014 04:03

Is it possible to change the html mark up that is rendered with the upload file form control in Kentico 7? I would like to remove the cellpadding and cellspacing so my HMTL validates in the w3.org validator. The following table code is rendered.

<table cellspacing="0" cellpadding="0" style="border-collapse:collapse;" class="UploaderTable">                     
<tbody><tr class="UploaderUpload">
<td><span class="UploaderLabel" id="p_lt_zonePageContainer_pageplaceholder_p_lt_zoneForm_NT_SubmitObjectForm_frmSubmitObject_f_PrimaryImage_PrimaryImage_lblUpload">Upload:</span><input type="file" class="UploaderInputFile" id="p_lt_zonePageContainer_pageplaceholder_p_lt_zoneForm_NT_SubmitObjectForm_frmSubmitObject_f_PrimaryImage_PrimaryImage_inputFile" name="p$lt$zonePageContainer$pageplaceholder$p$lt$zoneForm$NT_SubmitObjectForm$frmSubmitObject$f$PrimaryImage$PrimaryImage$inputFile"><label style="display:none;" id="p_lt_zonePageContainer_pageplaceholder_p_lt_zoneForm_NT_SubmitObjectForm_frmSubmitObject_f_PrimaryImage_PrimaryImage_lblUpload_inputFile" for="p_lt_zonePageContainer_pageplaceholder_p_lt_zoneForm_NT_SubmitObjectForm_frmSubmitObject_f_PrimaryImage_PrimaryImage_inputFile">Upload file</label></td>

Recent Answers

Brenden Kehren answered on December 6, 2014 05:57

In the webpart, render tables as divs. You can do this at the very bottom of the webpart. Otherwise you'd have to modify the base code (form control)

0 votesVote for this answer Mark as a Correct answer

Will Lin answered on December 11, 2014 22:03

Hi Brenden, I've followed your steps as mentioned in your last comment. Although the markup now renders in divs as opposed to tables, it now creates a different validation error in the w3.org validator.

The 'for' attribute of the label element must refer to a form control.

Any ideas on how to validate with w3.org validator when using the upload file form control?

0 votesVote for this answer Mark as a Correct answer

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