Using JavaScript to pull information

Home Forums Quform WordPress Using JavaScript to pull information

This topic is: not resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #36436
    GOMLP
    Participant

    Hi Ally,

    I hope this message finds you well and Happy New Year.

    Once again I’m seeking your assistance.

    I’m trying to create an event register form. Each client will be mailed a personalized invite with a unique registration code.

    When they go to register online the form will ask for them to enter their unique code to proceed to the Entry Form.

    I want this unique code to look up a JQuery and populate an HTML text element with information on the next page.

    Registration Code = Company Name

    A6HH8375GT = Acme Co. Ltd.
    BG6DE527HT = Jon’s Smoking Hot Sauce

    Is it possible you could shed some insight on how to do this using Custom JavaScript once again for me please.

    #36438
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #36455
    GOMLP
    Participant

    Hi Ally,

    Sorry for the delay in responding. The code worked good, however I’ve been trying to play around with it a bit more to extend the functionality and I’m not having much luck.

    My goal is to allow the customer to enter their unique invitation code on the first page and when proceeding to the second page of the form it will look up the customer’s information based on this unique invitation code so I can use this looked up information in a custom HTML header text for display, while also pre populating form fields to confirm that their phone number, email and mailing addresses information is correct. If their information needs to be updated the customer can either click on a check box to either enable editing of the information field(s) or simply overwrite the looked up information for submission.

    But in either case I want to be able to look up this information for; 1) Customizing an HTML welcome header on the second page and 2) populating form fields with the looked up information.

    jQuery(function ($) {
    var contactInfo = {
    ’11’: {
    firstName: ‘Todd’,
    lastName: ‘Rose’,
    eMailAddress: ‘toddl@gomlp.net’,
    phoneNumber: ‘(902) 835-2400’,
    companyName: ‘Maritime Labels & Packaging’,
    mailingStreetAddress: ‘9172 Highway 14’,
    mailingCity: ‘Milford’,
    mailingProvince: ‘Nova Scotia’,
    mailingPostalCode: ‘B0N 1Y0’,
    shippingAddress: ‘9172 Highway 14’,
    shippingCity: ‘Milford’,
    shippingProvince: ‘Nova Scotia’,
    shippingPostalCode: ‘B0N 1Y0′
    },
    ’22’: {
    firstName: ‘Paul’,
    lastName: ‘Sproule’,
    eMailAddress: ‘paul@gomlp.net’,
    phoneNumber: ‘(902) 835-2400’,
    companyName: ‘Maritime Labels & Packaging’,
    mailingStreetAddress: ‘9172 Highway 14’,
    mailingCity: ‘Milford’,
    mailingProvince: ‘Nova Scotia’,
    mailingPostalCode: ‘B0N 1Y0’,
    shippingAddress: ‘9172 Highway 14’,
    shippingCity: ‘Milford’,
    shippingProvince: ‘Nova Scotia’,
    shippingPostalCode: ‘B0N 1Y0′
    },
    ’33’: {
    firstName: ‘Kyle’,
    lastName: ‘Tomblin’,
    eMailAddress: ‘kyle@gomlp.net’,
    phoneNumber: ‘(902) 835-2400’,
    companyName: ‘Maritime Labels & Packaging’,
    mailingStreetAddress: ‘9172 Highway 14’,
    mailingCity: ‘Milford’,
    mailingProvince: ‘Nova Scotia’,
    mailingPostalCode: ‘B0N 1Y0’,
    shippingAddress: ‘9172 Highway 14’,
    shippingCity: ‘Milford’,
    shippingProvince: ‘Nova Scotia’,
    shippingPostalCode: ‘B0N 1Y0’
    },
    };

    $(‘.quform-field-12_7’).on(‘change’, function () {
    var value = $(this).val();

    if (value && contactInfo[value]) {
    var contact = contactInfo[value];

    $(‘.quform-element-12_38 .quform-spacer’).html(contact.firstName);
    $(‘.quform-element-12_36 .quform-spacer’).html(substrate.lastName);
    $(‘.quform-element-14_1065 .quform-spacer’).html(substrate.adhesive);
    $(‘.quform-element-14_1069 .quform-spacer’).html(substrate.min_app_temp);
    $(‘.quform-element-14_1075 .quform-spacer’).html(substrate.service_temp_range);
    }
    });
    });

    #36458
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #36461
    GOMLP
    Participant

    Hi Ally,

    I fixed the code discrepancies and apologize for that. I now have the code corrected, however I still can’t seem to pull in that information from within the custom JS to display a custom message at the top with the client’s name.

    And for the likes of me I can’t seem to figure out how to pull the JS code to auto-fill fields.

    I’ve send you a message with the URL link and username and password for you to have a look at.

    Thanking you in advance,
    Todd R

    #36462
    GOMLP
    Participant

    Hi Ally,

    Once again I thank you! Your assistance on this was greatly helpful and taught me something new.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy