Hi Jessica,
You can retrive user information before submit with this kind of example, where you can modify layout of Logon webpart on this way:
<script runat="server">
public bool IsAuthDisabled(string userName)
{
var user = CMS.Membership.UserInfoProvider.GetUsers().WhereEquals("UserName", userName).Column("UserCustomField");
if (!DataHelper.DataSourceIsEmpty(user))
{
return ValidationHelper.GetBoolean(user.Tables[0].Rows[0]["UserCustomField"], false);
}
return false;
}
protected void UserName_TextChanged(object sender, EventArgs e)
{
TextBox txtUserName = (TextBox)sender;
if (IsAuthDisabled(txtUserName.Text))
{
//Hide
}
else
{
//Show
}
}
</script>
Also it's required to add this change on UserName TextBox as well:
<cms:CMSTextBox ID="UserName" runat="server" AutoPostback="true" OnTextChanged="UserName_TextChanged"/>
In this way, you can retrieve custom field for the user based on entered username before user exactly log in on the page.
NOTE: I will suggest you to clone LogonForm web part and customize there directly what you need, to make code clean.
Best regards,
Dragoljub