Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 2 of 2

Thread: Create new account -> company name required

  1. #1
    PghKid is offline Junior Member
    Join Date
    May 2007
    Posts
    23

    Default Create new account -> company name required

    Is there a way to make the company name be a required field on the new account creation page when checking out?

  2. #2
    ASPAlfred is offline Senior Member
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    Absolutely. This can be done in three steps.

    1.
    From the createaccount.aspx, find these lines:
    Code:
    <td width="35%" align="right"><asp:Literal ID="createaccountaspx40" runat="server" Text="(!createaccount.aspx.40!)"></asp:Literal></td>
    <td width="65%"><asp:TextBox ID="BillingCompany" Columns="34" MaxLength="100" runat="server" /></td>
    change it to:
    Code:
    <td width="35%" align="right"><asp:Literal ID="createaccountaspx40" runat="server" Text="(!createaccount.aspx.40!)"></asp:Literal></td>
    <td width="65%">
          <asp:TextBox ID="BillingCompany" Columns="34" MaxLength="100" runat="server" CausesValidation="true" ValidationGroup="createaccount" />
         <asp:RequiredFieldValidator ID="valReqBillCompany" ControlToValidate="BillingCompany" EnableClientScript="false" runat="server" ValidationGroup="createaccount" Display="None"></asp:RequiredFieldValidator>
    </td>
    2.
    You'll need to go to your String Resource Mgr in the admin and add this string:
    Name = Createaccount.aspx.billcompany
    Value = Please enter the company billing name

    3.
    From createaccount.aspx.cs, find the InitializeValidationErrorMessages() method and add this:
    Code:
    valReqBillCompany.ErrorMessage = AppLogic.GetString("Createaccount.aspx.billcompany", SkinID, ThisCustomer.LocaleSetting);
    As always, make sure to have a backup of these files first before doing any change.