# SetData Method The SetData method writes user information to the SmartCard. Syntax
    [long=] SiteKiosk.Plugins("SiteCash").Devices("ACOS").CustomerData.
          SetData(index, data)
Parameters
index | Long value that specifies the index of the data to write.
data | String containing the data to write.
Return Value Returns a Long value containing the ID of the read request. Remarks The values that can be saved to the SmartCard are referenced through the numbers 0 to 6: 0: Name 1: eMail address 2: POP server 3: POP password 4: Free data 5: Start page 6: Currency Examples The following example writes data to the card.
    <a href="javascript:getAllData();">get all data</a>
    <a href="javascript:setAllData();">set all data</a>
    <SCRIPT TYPE="text/javascript">
    window.external.InitScriptInterface();
    smartcard = SiteKiosk.Plugins("SiteCash").Devices("ACOS");
    function getAllData()
    {
       smartcard.CustomerData.GetData(NameReady, 0);
       smartcard.CustomerData.GetData(EmailAddressReady, 1);
       smartcard.CustomerData.GetData(POPServerReady, 2);
       smartcard.CustomerData.GetData(POPPasswordReady, 3);
       smartcard.CustomerData.GetData(FreeDataReady, 4);
       smartcard.CustomerData.GetData(StartpageReady, 5);
       smartcard.CustomerData.GetData(CurrencyReady, 6);
    }
    function setAllData()
    {
       smartcard.CustomerData.SetData(0, "New name");
       smartcard.CustomerData.SetData(1, "New email address");
       smartcard.CustomerData.SetData(2, "New POP server");
       smartcard.CustomerData.SetData(3, "New POP password");
       smartcard.CustomerData.SetData(4, "New free data");
       smartcard.CustomerData.SetData(5, "New startpage");
       smartcard.CustomerData.SetData(6, "New currency");
    }
    function NameReady(id, index, data)
    {
       alert("Name: " + data);
    }
    function EmailAddressReady(id, index, data)
    {
       alert("Email address: " + data);
    }
    function POPServerReady(id, index, data)
    {
       alert("POP server: " + data);
    }
    function POPPasswordReady(id, index, data)
    {
       alert("POP password: " + data);
    }
    function FreeDataReady(id, index, data)
    {
       alert("Free data: " + data);
    }
    function StartpageReady(id, index, data)
    {
       alert("Startpage: " + data);
    }
    function CurrencyReady(id, index, data)
    {
       alert("Currency: " + data);
    }
    </SCRIPT>
Applies to SiteKiosk v5.0 (and later versions). Back to top