mapping for formID and fieldID

Home Forums Quform WordPress mapping for formID and fieldID

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #35149
    wp_tc_questions
    Participant

    I’m considering creating some custom php to map form ID and field ID to plain English.

    I.e.

    function getQUFormID($plainEnglishID ) {
    quform_2 -> LandingPage
    quform_2_1 -> LandingPage_Username

    quform_3 -> FoodOrder
    quform_3_1 -> FoodOrder_FirstName
    quform_3_2 -> FoodOrder_DeliveryInstructions

    quform_4 -> HelpTicket
    quform_4_1->HelpTicket_

    return $ID;
    }

    and in subsequent code call

    $FoodOrder = $form->getValueText( getQUFormID(‘FoodOrder_DeliveryInstructions’) );

    instead of ….

    $FoodOrder = $form->getValueText( ‘quform_3_2’ );

    The idea being the code is easier to read and if the field ID changes later on there is only one line of code to change that lives in one centralized place rather than 5 lines scattered across several php files.

    Has anyone implemented a similar approach or am I missing a better idea? I considered custom CSS on every field….

    #35154
    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.

Viewing 2 posts - 1 through 2 (of 2 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