If you ever tried to extract the “created by” user information in a SharePoint2010 edit form, you probably noticed that there’s no out-of-the-box solution for this situation. I think i might have found a work-around. I used jQuery to extract the user name from a rendered SharePoint control.
Step 1: Add the following SharePoint control to your form. This will render some additional HTML code, but you can place this control easily within a hidden table row.
<SharePoint:FieldValue ControlMode="Display" FieldName="Author" DisableInputFieldLabel="true" runat="server"/>
Step 2: Add the following lines to your jQuery document.ready() function and you’ll get the author from the selected item.
var author; author = $('a[href^="/_layouts/userdisp.aspx?"]').text();
