Ciao a tutti, devo inserire su di un form il controllo su di un checkbox per autorizzale la famosa privacy...
Il form che ho è gia impostato e dovrei modificarlo per raggiungere il mio scopo![]()
la paginetta e fatta con i contro ..... i messaggi di errori se li chiama da una pagina esterna come anche i testi (es: per le varie lingue)![]()
Di controlli ne ho a sufficienza, ma non mi funzionano in questa pagina!!!
vi faccio vedere di cosa si tratta ( compreso le mie modifiche)
calcolate che ho dovuto interrompere lo script; troppi caratteri..
Ps: vi attendo a braccia aperte e sicuramente a buon rendere![]()
A presto
{* registration form *}
<center>
<table width=70% border=0>
<tr>
<td colspan=2 align=center>
{if $order ne NULL}
{$smarty.const.STRING_ORDER_CONTINUE_TIP}
{/if}
</td>
</tr>
<tr>
<td align=center>
{if $order}
<form action="index.php?register=yes&order=yes" method=post name='RegisterForm'>
{else}
<form action="index.php?register=yes" method=post name='RegisterForm'>
{/if}
<table border=0 width=70%>
<tr>
<td colspan=3 align=center>
<u>{$smarty.const.STRING_REGISTRATION_FORM}</u>
{$smarty.const.STRING_REQUIRED}
{if $reg_error ne NULL}
<font color=red>{$reg_error}
</font>
{/if}
</td>
</tr>
<tr>
<td colspan=3 align=center>
<table bgcolor=#{$smarty.const.CONF_MIDDLE_COLOR} width=80% border=0>
<tr>
<td>
<font color=black class=small>
{$smarty.const.STRING_AUTHORIZATION_FIELDS}
</font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=2 width=50% align=right>
<font color=red>*</font>
{$smarty.const.CUSTOMER_LOGIN}
</td>
<td width=50%><input type="text" name="login"
value="{$login}">
</td>
</tr>
<tr>
<td colspan=2 align=right>
<font color=red>*</font>
{$smarty.const.CUSTOMER_PASSWORD}
</td>
<td>
<input type="password" name="cust_password1" value="{$cust_password1}">
</td>
</tr>
<tr>
<td colspan=2 align=right>
<font color=red>*</font>
{$smarty.const.CUSTOMER_CONFIRM_PASSWORD}
</td>
<td>
<input type="password" name="cust_password2" value="{$cust_password2}">
</td>
</tr>
<tr>
<td colspan=3 align=center>
<table bgcolor=#{$smarty.const.CONF_MIDDLE_COLOR} width=80%>
<tr>
<td>
<font color=black class=small>
{$smarty.const.STRING_GENERAL_INFORMATION}
</font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan=2 align=right>
<font color=red>*</font>
{$smarty.const.CUSTOMER_FIRST_NAME}
</td>
<td>
<input type="text" name="first_name"
value="{$first_name}">
</td>
</tr>
<tr>
<td colspan=2 align=right>
<font color=red>*</font>
{$smarty.const.CUSTOMER_LAST_NAME}
</td>
<td>
<input type="text" name="last_name"
value="{$last_name}">
</td>
</tr>
<tr>
<td colspan=2 align=right>
<font color=red>*</font>
{$smarty.const.CUSTOMER_EMAIL}
</td>
<td>
<input type="text" name="email"
value="{$email}">
</td>
</tr>
<tr>
<td colspan="2" align=right><input type=checkbox
name=subscribed4news {if $subscribed4news == 1}checked{/if}></td>
<td>{$smarty.const.CUSTOMER_SUBSCRIBE_FOR_NEWS} </td>
</tr>
<tr>
<td colspan=2 align=right><font color=red>* </font><input type=checkbox
name=privacy {if $privacy == 1}checked{/if} value="{$privacy}"></td><td>{$smarty.const.CUSTOMER_PRIVACY}</td>
</tr>
..................();'
>
{section name=i loop=$countries}
<option value={$countries[i].countryID}
{if $countryID ne NULL}
{if $countries[i].countryID == $countryID}
selected
{/if}
{else}
{if $countries[i].countryID == $smarty.const.CONF_DEFAULT_COUNTRY}
selected
{/if}
{/if}
>
{$countries[i].country_name}
</option>
{/section}
</select>
{else}
<input type=hidden name='countryID' value='NULL'>
{/if}
</td>
</tr>
</table>
{literal}
<script language='JavaScript'>
function billingAddressCheckHandler()
{
return;
}
</script>
{/literal}
</td>
<tr>
<td></td>
<td></td>
<td></td>
{if $order ne NULL}
<tr>
<td colspan=3 align=center>
<table>
<tr>
<td rowspan=8>
{$smarty.const.STRING_BILLING_ADDRESS}
</td>
<td colspan=3>
<input type=checkbox name='billing_address_check' value='1'
onclick='JavaScript:billingAddressCheckHandler()'
{if $billing_address_check}
{/if} checked
>
{$smarty.const.STRING_EQUAL_TO_SHIPPING_ADDRESS}
</td>
</tr>
<tr>
<td colspan=2 align=right>
<font color=red>*</font>
{$smarty.const.STRING_PAYER_FIRST_NAME}
</td>
<td>
<input type=text name='payer_first_name'
value='{$payer_first_name}'>
</td>
</tr>
<tr>
<td colspan=2 align=right>
<font color=red>*</font>
{$smarty.const.STRING_PAYER_LAST_NAME}
</td>
<td>
<input type=text name='payer_last_name'
value='{$payer_last_name}'>
</td>
</tr>
{if $smarty.const.CONF_ADDRESSFORM_ADDRESS ne 2}
<tr>
<td colspan=2 align=right>
{if $smarty.const.CONF_ADDRESSFORM_ADDRESS eq 0}<font color=red>*</font>{/if}
{$smarty.const.CUSTOMER_ADDRESS}
</td>
<td>
<textarea name="billingAddress" rows=4
value='{$billingAddress}'>{$billingAddress}</textarea>
</td>
</tr>
{else}
<input type=hidden name='billingAddress' value=''>
{/if}
{if $smarty.const.CONF_ADDRESSFORM_CITY ne 2}
<tr>
<td colspan=2 align=right>
{if $smarty.const.CONF_ADDRESSFORM_CITY eq 0}<font color=red>*</font>{/if}
{$smarty.const.CUSTOMER_CITY}
</td>
<td>
<input type="text" name="billingCity"
value="{$billingCity}">
</td>
</tr>
{else}
<input type=hidden name='billingCity' value=''>
{/if}
{if $smarty.const.CONF_ADDRESSFORM_STATE ne 2}
<tr>
<td colspan=2 align=right>
{if $smarty.const.CONF_ADDRESSFORM_STATE eq 0}<font color=red>*</font>{/if}
{$smarty.const.CUSTOMER_STATE}
</td>
<td>
{if !$billingZones}
<input type="text" name="billingState"
value="{$billingState}">
{else}
<select name=billingZoneID>
{section name=i loop=$billingZones}
<option value={$billingZones[i].zoneID}
{if $billingZones[i].zoneID == $billingZoneID}
selected
{/if}
>
{$billingZones[i].zone_name}
</option>
{/section}
</select>
{/if}
</td>
</tr>
{else}
{if !$billingZones}
<input type="hidden" name="billingState" value="">
{else}
<input type="hidden" name="billingZoneID" value="">
{/if}
{/if}
{if $smarty.const.CONF_ADDRESSFORM_ZIP ne 2}
<tr>
<td colspan=2 align=right>
{if $smarty.const.CONF_ADDRESSFORM_ZIP eq 0}<font color=red>*</font>{/if}
{$smarty.const.CUSTOMER_ZIP}
</td>
<td>
<input type="text" name="billingZip"
value="{$billingZip}">
</td>
</tr>
{else}
<input type=hidden name='billingZip' value=''>
{/if}
<tr>
<td colspan=2 align=right>
{if $countries}
<font color=red>*</font>
{$smarty.const.CUSTOMER_COUNTRY}
{/if}
</td>
<td>
{if $countries}
<select name=billingCountryID
onchange='JavaScript:changeCountryHandler();'
>
{section name=i loop=$countries}
<option value={$countries[i].countryID}
{if $billingCountryID ne NULL}
{if $countries[i].countryID == $billingCountryID}
selected
{/if}
{else}
{if $countries[i].countryID == $smarty.const.CONF_DEFAULT_COUNTRY}
selected
{/if}
{/if}
>
{$countries[i].country_name}
</option>
{/section}
</select>
{else}
<input type=hidden name='billingCountryID' value='NULL'>
{/if}
</td>
</tr>
</table>
<input type=hidden value='' name='billing_address_checkHiddenField'>
{literal}
<script language='JavaScript'>
function billingAddressCheckHandler()
{
if ( (document.RegisterForm.billingCountryID.value !=
document.RegisterForm.countryID.value) &&
document.RegisterForm.billing_address_check.checke d )
{
document.RegisterForm.submit();
return;
}
{/literal}
document.RegisterForm.payer_first_name.disabled =
document.RegisterForm.billing_address_check.checke d;
document.RegisterForm.payer_last_name.disabled =
document.RegisterForm.billing_address_check.checke d;
document.RegisterForm.billingCountryID.disabled =
document.RegisterForm.billing_address_check.checke d;
{if !$billingZones}
document.RegisterForm.billingState.disabled =
document.RegisterForm.billing_address_check.checke d;
{else}
document.RegisterForm.billingZoneID.disabled =
document.RegisterForm.billing_address_check.checke d;
{/if}
document.RegisterForm.billingZip.disabled =
document.RegisterForm.billing_address_check.checke d;
document.RegisterForm.billingCity.disabled =
document.RegisterForm.billing_address_check.checke d;
document.RegisterForm.billingAddress.disabled =
document.RegisterForm.billing_address_check.checke d;
{literal}
if ( document.RegisterForm.billing_address_check.checke d )
{
{/literal}
document.RegisterForm.payer_first_name.value =
document.RegisterForm.receiver_first_name.value;
document.RegisterForm.payer_last_name.value =
document.RegisterForm.receiver_last_name.value;
document.RegisterForm.billingCountryID.value =
document.RegisterForm.countryID.value;
{if !$billingZones}
document.RegisterForm.billingState.value =
document.RegisterForm.state.value;
{else}
document.RegisterForm.billingZoneID.value =
document.RegisterForm.zoneID.value;
{/if}
document.RegisterForm.billingZip.value =
document.RegisterForm.zip.value;
document.RegisterForm.billingCity.value =
document.RegisterForm.city.value
document.RegisterForm.billingAddress.value =
document.RegisterForm.address.value;
{literal}
}
}
billingAddressCheckHandler();
</script>
{/literal}
</td>
</tr>
{/if}
{if $smarty.const.CONF_ENABLE_CONFIRMATION_CODE}
<tr>
<td colspan=3 align=center>
<div class="small" style="color: black;width:80%; padding: 3px; text-align: left; background-color:#{$smarty.const.CONF_MIDDLE_COLOR}">
{$smarty.const.STR_CONFIRMATION_CODE}
</div>
</td>
</tr>
<tr>
<td align="right">
[img]../multimedia_com/templates/frontend/tmpl3/imgval.php[/img]
</td>
<td>
</td>
<td align="left">
<input name="fConfirmationCode" style="color:#aaaaaa" value="{$smarty.const.STR_ENTER_CCODE}" type="text" onfocus="if(this.value=='{$smarty.const.STR_ENTER_ CCODE}')
{literal}
{this.style.color='#000000';this.value='';}
{/literal}" onblur="if(this.value=='')
{literal}{{/literal}this.style.color='#aaaaaa';this.value='{$s marty.const.STR_ENTER_CCODE}'{literal}}{/literal}" />
</td>
</tr>
{/if}
</table>
{literal}
<script language='JavaScript'>
function changeCountryHandler()
{
document.RegisterForm.submit();
}
</script>
{/literal}
<input type="submit" value="{$smarty.const.OK_BUTTON}" name=save>
<input type=reset value="{$smarty.const.RESET_BUTTON}">
</p>
{if $order ne NULL}
<input type=hidden name=order value=1>
{/if}
{if $order_without_billing_address ne NULL}
<input type=hidden name=order_without_billing_address value=1>
{/if}
</form>
{if $reg_updating && $log != $smarty.const.ADMIN_LOGIN}
[ {$smarty.const.TERMINATE_ACCOUNT_LINK} ]</p>
{/if}
</td>
<td></td>
</tr>
</table>
</center>