Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-17 09:07:56

ricoschette
Member
From: Estonia
Registered: 2005-09-17
Posts: 176

zem_contact_reborn: Can't validate html

I’ve almost finished with Kirby vaccuum cleaners website.

I was wondering if there’s ways to make html code better, so it would validate. It uses many ID’s, the element that cannot be repeated on one page. And some messy urls.

Check out the source.
W3C validator

(Edit: updated discussion topic. -Mary)

Last edited by Mary (2007-08-18 14:12:34)

Offline

#2 2007-08-17 09:31:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn: Can't validate html

Most if not all those validation errors are caused by placing multiple identical ZCR contact forms on a single page. You’d have to replace that with a single ZCR form or make all forms unique (requires some PHP code or the use of the asy_wondertag plugin)

Offline

#3 2007-08-17 13:23:37

ricoschette
Member
From: Estonia
Registered: 2005-09-17
Posts: 176

Re: zem_contact_reborn: Can't validate html

ruud wrote:

Most if not all those validation errors are caused by placing multiple identical ZCR contact forms on a single page. You’d have to replace that with a single ZCR form or make all forms unique (requires some PHP code or the use of the asy_wondertag plugin)

Exactly.

Yeah, I’d like to create a single order form, but my skills just aren’t there to back me up :P

Offline

#4 2007-08-17 13:39:20

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn: Can't validate html

There are a few things you’ll have to do:
In the <txp:zem_contact> container, add <-- <txp:article_id /> -->. That makes the form_id unique.

And for the other form tags, if you have:

<txp:zem_contact_email name="email" label="Email" />

change that to (requires the asy_wondertag plugin):

<txp:asy_wondertag><txp:zem_contact_email name="email<txp:article_id />" label="Email" /></txp:asy_wondertag>

That makes the names of the input fields unique using the article_id.

Last edited by ruud (2007-08-17 13:40:22)

Offline

#5 2007-08-17 14:55:20

ricoschette
Member
From: Estonia
Registered: 2005-09-17
Posts: 176

Re: zem_contact_reborn: Can't validate html

Oh, I didn’t know that.
Tnx a lot!!

I did what you told me to do and got errors down to 12 :)
2 errors per article.
Only error left is the form ID.

Last edited by ricoschette (2007-08-22 13:23:39)

Offline

#6 2007-08-22 13:29:33

ricoschette
Member
From: Estonia
Registered: 2005-09-17
Posts: 176

Re: zem_contact_reborn: Can't validate html

Ruud, I’m still little confused about your suggestion about putting <txp:article_id /> inside of the zem_contact form.

I can’t put the entire contact form inside of wondertags, and it won’t work when written like this: <txp:zem_contact redirect=“tolmuimejad” to=“name@host.ee” id=”<txp:article_id />”>
Of course that’s because there’s no option as “id” for this particular case.

I’m missing smth here…

Offline

#7 2007-08-22 13:46:23

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn: Can't validate html

I meant this:

<txp:zem_contact ... >
   ... all the other <txp:zem_contact_**** /> tags here
   <!--<txp:article_id />-->
</txp:zem_contact>

Last edited by ruud (2007-08-22 13:46:46)

Offline

#8 2007-08-22 14:47:39

ricoschette
Member
From: Estonia
Registered: 2005-09-17
Posts: 176

Re: zem_contact_reborn: Can't validate html

just in case I pasted a code for you, because that’s not working.

<txp:zem_contact redirect=“tolmuimejad” to=“name@host.ee”>
<strong><txp:title /></strong><br />
<txp:asy_wondertag><txp:zem_contact_email name=“email<txp:article_id />” label=“Email” /></txp:asy_wondertag><br />
<txp:asy_wtag><txp:zem_contact_hidden label=“Artikli number on” value=”<txp:article_id />” /></txp:asy_wtag>
<txp:asy_wondertag><txp:zem_contact_text name=“name<txp:article_id />” label=“Nimi” /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_text name=“phone<txp:article_id />” label=“Telefon” /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_text name=“address<txp:article_id />” label=“Aadress” /></txp:asy_wondertag><br />
Lisavarustus: (pole kohustuslik)<br />
<txp:asy_wondertag><txp:zem_contact_checkbox name=“Pesur<txp:article_id />” label=“Vaibapesur” required=“0” /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_checkbox name=“Hari<txp:article_id />” label=“Turbohari” required=“0” /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_checkbox name=“Lihv<txp:article_id />” label=“Lihvija” required=“0” /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_checkbox name=“Vahat<txp:article_id />” label=“Põrandavahataja” required=“0” /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_textarea name=“Message<txp:article_id />” label=“Märkused” /></txp:asy_wondertag>
<!—<txp:article_id />—>
<txp:zem_contact_submit />
</txp:zem_contact>

Offline

#9 2007-08-22 15:00:53

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn: Can't validate html

Ah, right… different approach: since you’re redirecting and thus not using the thanks attribute, you can abuse it to make the zem_contact tag unique ;)

<txp:asy_wondertag><txp:zem_contact redirect="tolmuimejad" to="name@host.ee" form="zcr" thanks="<txp:article_id />" /></txp:asy_wondertag>

and put the rest in a form called ‘zcr’:

<strong><txp:title /></strong><br />
<txp:asy_wondertag><txp:zem_contact_email name="email<txp:article_id />" label="Email" /></txp:asy_wondertag><br />
<txp:asy_wtag><txp:zem_contact_hidden label="Artikli number on" value="<txp:article_id />" /></txp:asy_wtag>
<txp:asy_wondertag><txp:zem_contact_text name="name<txp:article_id />" label="Nimi" /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_text name="phone<txp:article_id />" label="Telefon" /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_text name="address<txp:article_id />" label="Aadress" /></txp:asy_wondertag><br />
Lisavarustus: (pole kohustuslik)<br />
<txp:asy_wondertag><txp:zem_contact_checkbox name="Pesur<txp:article_id />" label="Vaibapesur" required="0" /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_checkbox name="Hari<txp:article_id />" label="Turbohari" required="0" /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_checkbox name="Lihv<txp:article_id />" label="Lihvija" required="0" /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_checkbox name="Vahat<txp:article_id />" label="Põrandavahataja" required="0" /></txp:asy_wondertag><br />
<txp:asy_wondertag><txp:zem_contact_textarea name="Message<txp:article_id />" label="Märkused" /></txp:asy_wondertag>
<txp:zem_contact_submit />

Offline

#10 2007-08-23 08:59:01

ricoschette
Member
From: Estonia
Registered: 2005-09-17
Posts: 176

Re: zem_contact_reborn: Can't validate html

tnx, it works like a charm :)

only thing’s that now the zem_contact_hidden gives error.

Offline

#11 2007-08-23 09:11:15

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn: Can't validate html

zem_contact_hidden doesn’t exist, you want zem_contact_secret ;)

Offline

#12 2007-08-23 13:37:14

ricoschette
Member
From: Estonia
Registered: 2005-09-17
Posts: 176

Re: zem_contact_reborn: Can't validate html

yes, I know.
I had some help from this forum and zem_contact’s php code was modified.

If I remember correctly, zem_contact_secret didn’t pull the necessary ID from article and I couldn’t use it. I guess, I’ll try it again…

Offline

Board footer

Powered by FluxBB