Passing value to complicated form field

by 5 replies
6
I have this stupidly complicated Form Field which I'm trying to pass variables to.



This is the form....the field I'm struggling with is the very last field ('Referral').

https://listings.quipmo.com/en/signup


Any ideas how I'd structure the URL to pass a value to it?


The form must be using a GET method as other fields (such as 'Name') can successfully get passed values via a query string. The problem is the other fields have a cleaner naming convention than the one that I've shared above which isn't so clean!


It's based on a Sharetribe backend....
#programming #complicated #field #form #passing
  • Hi @thefreedomchaser,
    what do you mean by pass variable to ?
    Do you mean collecting the value that a user types into this field (Referral in your case) ?

    I can help you but there isn't enough details in your post
    • [1] reply
    • Thanks for your offer to help. Basically I want to create URL that includes the 'referral' field within it, so that I can share it with our ambassadors and know when they refer a new user.
      • [1] reply
  • I can also help out with some more info.
    Had a quick look, and the form itself sends a POST

    So I'm guessing you are receiving a GET request, which you are to pre-populate the fields with?

    Assuming the above, you'll just have to map the incoming indexes with the ID or names you have in the form.

    Not knowing what you are generating the form with, one last resort could be to do the mapping and inject javascript to populate the fields...


    Just my two cents, based on some guesses..
  • Yep, you could do this with some code on the client side to read the query strings you pass in through the url, and set the values in the forms.

    Here is an article... https://stackoverflow.com/questions/...alues-from-url
  • [DELETED]

Next Topics on Trending Feed