Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Quick quote with ZRC with transfering to more detailed form
admi wrote #302246:
I think about it as the only option. I never used adi_gps though. “In your template” – Do I use adi_gps tags on the page with short form, right?
No, on the page that the short form points to, e.g. in your case the ZCR page.
It works like this: when you fill out an HTML form it sends the results to the destination (action) page either as GET parameters in the URL (e.g.?nombre=admi&email=admi@admi.com) or as POST variables (not visible in the URL) depending on the method you set. POST is the most typical method with forms.
You use adi_gps / rah_gps on the page template where you have your ZCR form to read out the value (e.g. the name or email etc.) passed to that page and store it in a txp variable, which you can then use to pre-populate your ZCR form. It’s very straightforward. For example
<!-- This is the destination page from the first short form -->
<!-- Extract a single POST variable called name and create a TXP variable of the same name -->
<txp:adi_gps name="nombre" quiet="1" />
…
<!-- use as tag-in-tag to pre-populate a ZCR form field -->
<txp:zem_contact_text name="applicant_name" label="Your Name" default='<txp:variable name="nombre" />' />
…
<!-- alternatively, display results as plain text and pass it on to the ZCR form invisibly -->
<p>Hello <txp:variable name="nombre" />,<p>
<txp:zem_contact_secret name="applicant_name" label="Your Name" value='<txp:variable name="nombre" />' />
or something like that.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Quick quote with ZRC with transfering to more detailed form
jakob wrote #302249:
No, on the page that the short form points to, e.g. in your case the ZCR page.
It works like this: when you fill out an HTML form it sends the results to the destination (action) page either as GET parameters in the URL (e.g.?nombre=admi&email=admi@admi.com) or as POST variables (not visible in the URL) depending on the method you set. POST is the most typical method with forms.
You use adi_gps / rah_gps on the page template where you have your ZCR form to read out the value (e.g. the name or email etc.) passed to that page and store it in a txp variable, which you can then use to pre-populate your ZCR form. It’s very straightforward. For example
<!-- This is the destination page from the first short form -->...
or something like that.
Thank you very much. I will try the option.
Offline
Re: Quick quote with ZRC with transfering to more detailed form
jakob wrote #302249:
No, on the page that the short form points to, e.g. in your case the ZCR page.
It works like this: when you fill out an HTML form it sends the results to the destination (action) page either as GET parameters in the URL (e.g.?nombre=admi&email=admi@admi.com) or as POST variables (not visible in the URL) depending on the method you set. POST is the most typical method with forms.
You use adi_gps / rah_gps on the page template where you have your ZCR form to read out the value (e.g. the name or email etc.) passed to that page and store it in a txp variable, which you can then use to pre-populate your ZCR form. It’s very straightforward. For example
<!-- This is the destination page from the first short form -->...
or something like that.
Hey! It works. It shows the variables on the page with ZCR! But… zem inputs do not have values, wonder what is wrong with ZCR? I put adi_gps variable into input placeholder, it displays a name, but does not display in on the message. So now have to see to ZCR value issue.
This one
<txp:zem_contact_secret name="applicant_name" label="Your Name" default='<txp:variable name="nombre" />' />
does not work.
Offline
Re: Quick quote with ZRC with transfering to more detailed form
I think you just got my examples muddled up. Check the docs for the exact attributes to use for each tag. For zem_contact_secret
, you need to use value='<txp:variable name="nombre" />'
to pass the variable’s value through to the ZCR email.
But it looks as if I was mistaken with the default
attribute for zem_contact_text
and zem_contact_email
. That passes a default value if nothing is entered. That has the same effect but, if I’ve understood it correctly, doesn’t show on screen. Have you tried to see if zem_contact_text will also accept a value
attribute for those tags?
BTW: you can also do this zem_contact_secret
:
<txp:zem_contact_text name="applicant_name" label="Your Name">
<txp:variable name="nombre" />
</txp:zem_contact_text>
I’m not sure if you can do that too with zem_contact_text and _email and _textarea. Try it out…
TXP Builders – finely-crafted code, design and txp
Offline
Re: Quick quote with ZRC with transfering to more detailed form
jakob wrote #302271:
I’m not sure if you can do that too with zem_contact_text and _email and _textarea. Try it out…
your instruction on adi_gps + zcr were very correct! but problem is with zcr. i use input_secret but i have to place <txp:variable name=“nombre” /> in placeholder=”<txp:variable name=“nombre” />” because nothing displayed within the field “name” after submitting the simple form. txp:zem_contact_text does not accept value=”“ unlike zem_contact_secret and default=”<txp:variable name=“nombre” /> or whatever “ shows nothing at all. i have to learn usage of default=”“. accroding to the manual it is supposed to display value=”“ – exactly what i need.
Offline
Re: Quick quote with ZRC with transfering to more detailed form
admi wrote #302278:
txp:zem_contact_text does not accept value
If you’re capturing the name already, why do you need it in an input box? Can you just populate the txp:zem_contact_secret with the actual value and just display (in a regular <p>
tag) the name they entered in the previous step?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Quick quote with ZRC with transfering to more detailed form
Bloke wrote #302280:
If you’re capturing the name already, why do you need it in an input box? Can you just populate the txp:zem_contact_secret with the actual value and just display (in a regular
<p>
tag) the name they entered in the previous step?
usually i saw captured data within fields on sites as though people inserted them on that the page and they need to fill more fields.
yes, i populate txp:zem_contact_secret all right! but how to i display txp:zem_contact_secret. it is invisible. or i missed something?
Offline
Re: Quick quote with ZRC with transfering to more detailed form
admi wrote #302281:
yes, i populate txp:zem_contact_secret all right! but how to i display txp:zem_contact_secret. it is invisible. or i missed something?
You have not missed anything. It is invisible, by design. What I meant was the second half of jakob’s post in the code block that begins with ‘alternatively…’
With that, you just display the captured name from adi_gps as plain text, as a visual reminder to the visitor. But it is not editable at that point.
A sort of related example: go and look at Txp’s admin side: Admin->Users. Click to edit your own user. You cannot alter your login name so it’s displayed as text, but you can alter everything else.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Quick quote with ZRC with transfering to more detailed form
Bloke wrote #302282:
You have not missed anything. It is invisible, by design. What I meant was the second half of jakob’s post in the code block that begins with ‘alternatively…’
With that, you just display the captured name from adi_gps as plain text, as a visual reminder to the visitor. But it is not editable at that point.
A sort of related example: go and look at Txp’s admin side: Admin->Users. Click to edit your own user. You cannot alter your login name so it’s displayed as text, but you can alter everything else.
Yes! I have done everything. It is almost what I expected (if ZCR had values it would be perfect) but at the final stage when I submitt the final form with false and some otional fields ZCR says – We do not accept spam, thank you! I wonder why?
Offline