我希望能夠根據複選框改變表格我的第一種形式:與按鈕無線電變化形式
<form action="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}" method="post"
id="login_form" class="box">
<h3 class="page-subheading connect_or">{l s='ou'}</h3>
<div class="form_content clearfix">
<div class="form-group">
<label for="email">{l s='Entrez votre email :'}</label>
<input class="is_required validate account_input form-control" data-validate="isEmail"
type="email" id="email" name="email" placeholder="Ex: [email protected]"
value="{if isset($smarty.post.email)}{$smarty.post.email|stripslashes}{/if}"/>
</div>
<div class="form-group">
<div class="radio">
<label>
<input id="radio_login" type="radio" name="optionsRadios" value="option1">
Je suis un nouveau client <em>(vous pourrez créer un compte par la suite)</em>
</label>
<br>
<label>
<input id="radio_login" type="radio" name="optionsRadios" value="option2">
J'ai déjà un compte et un mot de passe
</label>
</div>
</div>
<div class="account_passwd">
<div class="form-group">
<label for="passwd">{l s='Votre mot de passe :'}</label>
<input class="is_required validate account_input form-control" type="password"
data-validate="isPasswd" id="passwd" name="passwd" value="" placeholder="*******"/>
</div>
<p class="lost_password form-group"><a href="{$link->getPageLink('password')|escape:'html':'UTF-8'}"
title="{l s='Recover your forgotten password'}"
rel="nofollow">{l s='Forgot your password?'}</a></p>
</div>
<p class="submit">
{if isset($back)}<input type="hidden" class="hidden" name="back"
value="{$back|escape:'html':'UTF-8'}" />{/if}
<button type="submit" id="SubmitLogin" name="SubmitLogin"
class="button btn btn-default button-medium">
<span>
{l s='valider'}
</span>
</button>
</p>
</div>
</form>
我的第二種形式:
<form action="{$link->getPageLink('authentication', true)|escape:'html':'UTF-8'}" method="post" id="create-account_form" class="box">
<div class="form_content clearfix">
<p>{l s='Please enter your email address to create an account.'}</p>
<div class="alert alert-danger" id="create_account_error" style="display:none"></div>
<div class="form-group">
<label for="email_create">{l s='Email address'}</label>
<input type="email" class="is_required validate account_input form-control" data-validate="isEmail" id="email_create" name="email_create" value="{if isset($smarty.post.email_create)}{$smarty.post.email_create|stripslashes}{/if}" />
</div>
<div class="submit">
{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'html':'UTF-8'}" />{/if}
<button class="button btn btn-default button-medium" type="submit" id="SubmitCreate" name="SubmitCreate">
<span>
<i class="icon-user left"></i>
{l s='Create an account'}
</span>
</button>
<input type="hidden" class="hidden" name="SubmitCreate" value="{l s='Create an account'}" />
</div>
<div class="form-group">
<div class="radio">
<label>
<input id="radio_create" type="radio" name="optionsRadios1" value="option1">
Je suis un nouveau client <em>(vous pourrez créer un compte par la suite)</em>
</label>
<br>
<label>
<input id="radio_create" type="radio" name="optionsRadios1" value="option2">
J'ai déjà un compte et un mot de passe
</label>
</div>
</div>
</div>
</form>
用於顯示一個條件或另一個是:
如果客戶端選擇單選按鈕「option1」,它將顯示錶單id =「new_account_form」,否則顯示錶單id =「login_form」。
謝謝
哪裏是你的代碼,說明你的問題」重新擁有? – Barmar