Question : Checking for @ symbol in email address field on access form

Hi experts,

I have a registration form in my database that stores the company employees details.  I would like to check the email address field to see if the @ sign has been used.  Could anybody help me achieve this?

Thank you.

Terry

Answer : Checking for @ symbol in email address field on access form

The renderingtemplate of these controls are defined in the folder CONTROLTEMPLATES within the HIVE folder, more specifically in DefaultTemplates.ascx using the RenderingTemplate MultipleLookupField.

So, navigate to:
c$\Program Files\Common Files\microsoft shared\Web Server Extensions\12\TEMPLATE\CONTROLTEMPLATES

Create a new .ascx and put the following code in there:

<%@ Control Language="C#"   AutoEventWireup="false" %>
<%@Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@Register TagPrefix="SharePoint" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.WebControls"%>
<%@Register TagPrefix="SPHttpUtility" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.SharePoint.Utilities"%>

<SharePoint:RenderingTemplate ID="MyCustomMultipleLookupField" runat="server">
      <Template>
            <SharePoint:GroupedItemPicker id="MultiLookupPicker" runat="server"
                  CandidateControlId="SelectCandidate"
                  ResultControlId="SelectResult"
                  AddButtonId="AddButton"
                  RemoveButtonId="RemoveButton"
                  />
            <table class="ms-long" cellpadding="0" cellspacing="0" border="0">
                  <tr>
                        <td class="ms-input">
                              <SharePoint:SPHtmlSelect id="SelectCandidate" Width="300" Height="125" runat="server" multiple="true" />
                        </td>
                        <td style="padding-left:10px">
                        <td align="center" valign="middle" class="ms-input"><button class="ms-buttonheightwidth" ID="AddButton" runat="server"> <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,multipages_gip_add%>" EncodeMethod='HtmlEncode'/> </button><br>
                              <br><button class="ms-buttonheightwidth" ID="RemoveButton" runat="server"> <SharePoint:EncodedLiteral runat="server" text="<%$Resources:wss,multipages_gip_remove%>" EncodeMethod='HtmlEncode'/> </button>
                        </td>
                        <td style="padding-left:10px">
                        <td class="ms-input">
                              <SharePoint:SPHtmlSelect id="SelectResult" Width="300" Height="125" runat="server" multiple="true" />
                        </td>
                  </tr>
            </table>
      </Template>
</SharePoint:RenderingTemplate>
 

Now go to SharePoint Designer and find your field.

Now add the attribute TemplateName and put it's value to MyCustomMultipleLookupField, like the following line:
<SharePoint:FormField TemplateName="MyCustomMultipleLookupField" runat="server" id="ff2{$Pos}" ControlMode="Edit" FieldName="ccc" __designer:bind="{ddwrt:DataBind('u',concat('ff2',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@ccc')}"/>

Issue an iisreset and take a look at your form.
Random Solutions  
 
programming4us programming4us