0

I am writing a form that takes zip code input. Javascript code determines city & state based on zip code. I would like the city and state to appear on a 'results' page that is displayed when the user completes the form. I can only get Template Toolkit to display the form input params on the result page. Is there a way to get the city and state to appear?

1
  • 2
    You'll need to pass the data via a URL string, local storage, or some other server-side mechanism. Without knowing anything about your site, there's not much more to say. Commented Jan 2, 2014 at 14:54

1 Answer 1

1

As @isherwood notes, without more detail it's hard to say.

But I would suspect you might want to have whatever does your Javascript city/state decoding push their results into some hidden or uneditable form fields, so they make the round-trip to your server and are available for the next round of TT rendering.

Sign up to request clarification or add additional context in comments.

1 Comment

This is EXACTLY what I wound up doing. I used type='hidden', changed all of the .innerHTML to .value, and passed the info to TT2. It works great.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.