tag:blogger.com,1999:blog-7258322562721325894.post5803761592105903930..comments2023-08-17T13:27:47.119+03:00Comments on How To Code: SharePoint: How to clear Metadata and People Editor fields using jQueryJussi Palohttp://www.blogger.com/profile/00392327346825133905noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-7258322562721325894.post-30826058355752593962014-05-08T14:31:17.999+03:002014-05-08T14:31:17.999+03:00I found a solution that works without the semicolo...I found a solution that works without the semicolon. Try this:<br />jQuery("#presenterMetadataDiv > span > span > input[type='hidden']").removeAttr("value");<br />jQuery("div[title='DISPLAYNAMEOFMETADATAFIELD'] > div > span[class$='valid-text']").remove();<br />jQuery("#presenterMetadataDiv > span span.ms-formvalidation[role='alert']").html("");<br /><br />Jeroen.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7258322562721325894.post-26011984658992867922014-05-05T11:09:25.880+03:002014-05-05T11:09:25.880+03:00Hello Jussi,
Great, just the code I was looking f...Hello Jussi,<br /><br />Great, just the code I was looking for. <br /><br />I need to empty a managed metadata field from the client. Your jQuery example works, but replaces the field value with a semicolon. Is there a way to make the field completely empty? (The field itself is not a required field).<br /><br />Thanks, Jeroen.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7258322562721325894.post-35080448143326262442013-06-25T15:25:10.498+03:002013-06-25T15:25:10.498+03:00Hello,
The above lines worked me with a few chang...Hello,<br /><br />The above lines worked me with a few changes:<br /> $("input[id$='UserField_HiddenUserFieldValue']").val("");<br /> $("span[id$='_UserField']").attr("editoroldvalue", "");<br /> $("input[id$='_UserField_hiddenSpanData']").val("");<br /> $("div[name='upLevelDiv']").html("");<br /> $("span[id$='UserField_errorLabel']").html("");<br /><br />Happy Scripting...Abhijith R Shastryhttps://www.blogger.com/profile/06323054467282788981noreply@blogger.com