i2p0design

Topic: how to make a checkbox obbligatory

hi to everybody
i'm new on this forum...

j'm working for add a checkbox into the end of post page...
i have made a table with the checkbox

Code:

<fieldset>
<legend>Privacy</legend>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="publish-label">privacy:</td>
<td>

<input type="checkbox" name="poster_check" id="poster_check" value=""/>

</td>
</tr>
</table>
</fieldset>

i'm working on publish-write.tpl

now how can i add a validation request for this box??

Last edited by i2p0design (2008-08-31 12:44:59)

matteoraggi

Re: how to make a checkbox obbligatory

this is the result till now with this code:
http://www.lavorohotel.net/post/

matteoraggi

Re: how to make a checkbox obbligatory

CODE USED NOW ON PAGE:

<fieldset>
<legend>Privacy</legend>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="publish-label"><strong>Trattamento dati</strong></td>
<td>

<input{if $errors.poster_check}class="error"{/if} tabindex="8" type="checkbox" name="poster_check" id="poster_check" value=""/>

{if $errors.poster_check}<span class="validation-error"><img src="{$BASE_URL}img/icon-delete.png" alt="" /></span>{/if}
</td>
<td>Si, accetto che i miei dati siano raccolti e trattati da Turicommit srl per i fini dichiarati nella <a href="http://www.lavorohotel.net/privacy/">Informativa Privacy
</a>. D.lgs 196/2003, Codice in materia di protezione dei dati personali.</td>
</tr>
<tr>
<td class="publish-label"><strong>Comunicazioni commerciali</strong></td>
<td>

<input type="checkbox" name="allow_privacy_1" id="allow_privacy_1" class="required-entry " />

<span class="validation-error">{if $errors.poster_check1}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>
</td>
<td>Acconsento al trattamento dei dati personali perche' siano utilizzati per tracciare un profilo delle mie scelte di consumo al fine di ricevere comunicazioni commerciali e offerte piu' mirate alle mie esigenze.   
Dette informazioni potranno essere utilizzate e/o comunicate in via confidenziale a societa' terze (Clienti o Partner) selezionate al fine di proporti prodotti e servizi reputati di tuo interesse da Parte di Turicommit srl.</td>
</tr>
</table>
</fieldset>

The_man

Re: how to make a checkbox obbligatory

I have tried this code, looks nice and all but it does not validate, even if you don´t check any of the checkboxes the form will still advance to the next page without stoping you at all and that´s not the point I think.

i2p0design

Re: how to make a checkbox obbligatory

The_man wrote:

I have tried this code, looks nice and all but it does not validate, even if you don´t check any of the checkboxes the form will still advance to the next page without stoping you at all and that´s not the point I think.

we know.. this is the little part of code we made until now.. but is only the tpl part... we need the script for make it work..

arturs

Re: how to make a checkbox obbligatory

i tried it too, it doesnt work, but looks quite ok.

matteoraggi

Re: how to make a checkbox obbligatory

here there is a sample of going checkbox done with smarty - tpl:
http://www.giorgiotave.it/forum/altri-l … -tags.html
or also in the page http://www.lavorohotel.net/post/ there is also a hidden checkbox saving data into DB to try to change and publish..

Last edited by matteoraggi (2008-09-01 21:52:17)

matteoraggi

Re: how to make a checkbox obbligatory

the sample code come from her,e maybe this could help?
http://php5utils.svn.sourceforge.net/vi … mons/tags/

matteoraggi

Re: how to make a checkbox obbligatory

It is possible to add checkboxes scripts also on apply page, here the sample :
http://www.lavorohotel.net/job/22/scamb … ure/#apply
but using the same code, it strange that they are checke on by default instead in POST JOB page they are by default off.. with little changes you cna get them off no problem anyway

Last edited by matteoraggi (2008-09-04 20:34:52)

arturs

Re: how to make a checkbox obbligatory

hod they made ir to validate, becouse i put the same code on my site but it does not validate. any ideas?

links

Re: how to make a checkbox obbligatory

Hi,

You can find all the code here:

http://www.jobberbase.com/forum/post1865.html#p1865