0

The "Full Name" field is a calculated field. It takes the First Middle Initial and Last name fields and concatenates them. I really only need that field to display in a dropdown. Then, when the user chooses an option, and submits the form, the entry will go onto another list field called "buyer". below is the code as added onto the body, unfortunately it is not displayed as pasted (please refer to the image):

<html>
    <head>
        <title>Get List Item Values</title>
        <script type="text/javascript" src="/sites/sites/sitecollection/subsite/JavierDevSite/SiteAssets/jquery-1.11.1.min.js"></script>
        <script type="text/javascript" src="/sites/sitecollection/subsite/JavierDevSite/SiteAssets/jquery.SPServices.min"></script>
        <script language="javascript" type="text/javascript">
            $(document).ready(function () {
                $().SPServices({
                    debug: true,
                    operation: "GetListItems",
                    async: false,
                    webURL: "https://url/sites/sitecollection/subsite",
                    listName: "BuyerList",
                    CAMLViewFields: "<ViewFields>FieldRef Name='First' /><FieldRef Name='Last' /><FieldRef Name='Middle Initial' /><FieldRef Name='Full Name' /></ViewFields>",
                    completefunc: function (xData, Status) {
                        $(xData.responseXML).SPFilterNode("z:row").each(function () {
                        events.push({
                            first: $(this).attr("ows_First"),
                            last: $(this).attr("ows_Last"),
                            middleInitial:$(this).attr("ows_Middle_Initial"),
                            fullname:$(this).attr("ows_Full_Name"),
                            });
                        });
                    }
                });
            })
        </script>
    </head>
    <body>
        <div id="fullname">
            <label> Full Name:</label>
            <select id="fullname" title="Full Name"></select>
        </div>
        <div>
            <small class="instruct-label">
            If the buyer name is not listed, please click on this link to enter
            the new buyer.</small>
        <div id="first">
            <label> First Name:</label>
            <select id='first' title="First Name"></select>
        </div>
        <div id="last">
            <label> Last Name:</label>
            <select id="last" title="Last Name"></select>
        </div>
    </body>
</html>

Get List Items values

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.