Closing </img> tag in form html
-
- Posts: 4
- Joined: Wed Nov 28, 2018
I've discovered an issue with a form I've created. It's a simple one, mostly checkboxes and date fields.
I added some javascript validation which didn't run. The console gave errors of unmatched end tags. I checked the code, all fine.
I removed my code (javascript and css), and still got the errors. It appears to be the table of form fields:
HTML1512: Unmatched end tag.
fd_Item_New.aspx (557, 719)
Which is this line:
<td class="ms-dtinput" >
<a href="#" onclick='clickDatePicker("ctl00_ctl38_g_1be77c03_50ac_4997_b4d2_ba7391ba2d04_Authorised_x0020_Car_x0020_Drive0Field_ctl00_ctl00_DateTimeField_DateTimeFieldDate", "\u002fSupportServices\u002fIMIT\u002fTestNLJ\u002f_layouts\u002f15\u002fiframe.aspx?&cal=1&lcid=2057&langid=1033&tz=-00:00:00.0007299&ww=0111110&fdow=1&fwoy=0&hj=0&swn=False&minjday=109207&maxjday=2666269&date=", "", event);return false;' ><img id="ctl00_ctl38_g_1be77c03_50ac_4997_b4d2_ba7391ba2d04_Authorised_x0020_Car_x0020_Drive0Field_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage" src="/_layouts/15/images/calendar_25.gif" border="0" alt="Select a date from the calendar."></img></a></td>
It appears that the forms designer has added code which includes a </img> tag (almost at the end of the code above) - which isn't needed.
How can I fix this error? Is it a bug?
I added some javascript validation which didn't run. The console gave errors of unmatched end tags. I checked the code, all fine.
I removed my code (javascript and css), and still got the errors. It appears to be the table of form fields:
HTML1512: Unmatched end tag.
fd_Item_New.aspx (557, 719)
Which is this line:
<td class="ms-dtinput" >
<a href="#" onclick='clickDatePicker("ctl00_ctl38_g_1be77c03_50ac_4997_b4d2_ba7391ba2d04_Authorised_x0020_Car_x0020_Drive0Field_ctl00_ctl00_DateTimeField_DateTimeFieldDate", "\u002fSupportServices\u002fIMIT\u002fTestNLJ\u002f_layouts\u002f15\u002fiframe.aspx?&cal=1&lcid=2057&langid=1033&tz=-00:00:00.0007299&ww=0111110&fdow=1&fwoy=0&hj=0&swn=False&minjday=109207&maxjday=2666269&date=", "", event);return false;' ><img id="ctl00_ctl38_g_1be77c03_50ac_4997_b4d2_ba7391ba2d04_Authorised_x0020_Car_x0020_Drive0Field_ctl00_ctl00_DateTimeField_DateTimeFieldDateDatePickerImage" src="/_layouts/15/images/calendar_25.gif" border="0" alt="Select a date from the calendar."></img></a></td>
It appears that the forms designer has added code which includes a </img> tag (almost at the end of the code above) - which isn't needed.
How can I fix this error? Is it a bug?
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Nick,
If you are not using Kendo template for Date field, the default template is rendered on the server, and we've had no input on the process, it's all default SharePoint rendering. As strange as it might seem, if it actually provides an error, it might be feasible to remove these tags with JavaScript before validation.
If you are not using Kendo template for Date field, the default template is rendered on the server, and we've had no input on the process, it's all default SharePoint rendering. As strange as it might seem, if it actually provides an error, it might be feasible to remove these tags with JavaScript before validation.
Cheers
-
- Posts: 4
- Joined: Wed Nov 28, 2018
Thanks Nikita
I'll try ignoring it and see if it works OK.
How would I use javascript to remove it?
I'll try ignoring it and see if it works OK.
How would I use javascript to remove it?
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Nick,
A tricky question, actually. Most browsers just fully ignore this tag, as if it's not there. Not sure why it would cause any issue. Can you tell me which browser you are using?
Technically, something like that should remove all the invalid HTML, though I still do not know why it would be interpreted by the browser in the first place:
A tricky question, actually. Most browsers just fully ignore this tag, as if it's not there. Not sure why it would cause any issue. Can you tell me which browser you are using?
Technically, something like that should remove all the invalid HTML, though I still do not know why it would be interpreted by the browser in the first place:
Code: Select all
var html = $(".ms-webpart-zone").html();
$(".ms-webpart-zone").html(html);
Cheers
-
- Posts: 4
- Joined: Wed Nov 28, 2018
Thanks Nikita
It's Internet Explorer, so it's probably just the usual strangeness
I've ignored it, and the form seems to be working OK. I'll check in other browsers.
It's Internet Explorer, so it's probably just the usual strangeness
I've ignored it, and the form seems to be working OK. I'll check in other browsers.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 29 guests