www.insideDHTML.com
Inside Dynamic HTML | Fun and Games | The 10K Demo | XML Online | CSS Online | Resources
Write Once! | DHTML Toolkits | Inside Techniques | Inside Scriptlets

Inside Techniques/

   

profileo() Function

The profileo() function uses IE4's User Profile object to automatically fill personal information into a form. To use this function, first define a form and provide the form element with a unique HTML ID. Next, when you define the text input boxes (<input type=text>), add an extra attribute "vCard" to specify what profile information should be included. IE4 currently supports the following profile information:
Email DisplayName FirstName
LastNameMiddleNameCellular
GenderJobTitlePager
CompanyDepartmentNotes
OfficeHomepageHome.StreetAddress
Home.CityHome.StateHome.Zipcode
Home.CountryHome.PhoneHome.Fax
Business.StreetAddressBusiness.CityBusiness.Phone
Business.FaxBusiness.URLBusiness.State
Business.CountryBusiness.Zipcode

For example:

  <FORM ID=demo>
    <P>Last Name: <INPUT TYPE="text" VCard="LastName">
    <P>First Name: <INPUT TYPE="text" VCard="FirstName">
    <P>E-Mail: <INPUT TYPE="text" VCard="Email">
    <P><INPUT TYPE="Button" ONCLICK="profileo(demo,'Inside Dynamic HTML')">
  </FORM>

To learn more, see our article on the User Profile ObjectIE4 Only.

profileo() Function

function profileo(x, t) {
        navigator.userProfile.clearRequest()

        for (i = 0; i < x.length; i++) {              
                if (x[i].type == "text") {
                        card = x[i].getAttribute("VCard");
                        if (card != null) {
                                navigator.userProfile.addReadRequest("VCard." + card);
                        }
                }
        }

        navigator.userProfile.doReadRequest(8, t)
        for (i = 0; i < x.length; i++) {
                if (x[i].type == "text") {
                        card = x[i].getAttribute("VCard");
                        if (card != null) {
                                x[i].value = navigator.userProfile.getAttribute("VCard." + card);
                        }
                }
        }
}