Jump to content

如何修改註冊頁面


CName

Recommended Posts

  • 1 year later...
我看了一下程式碼輸出 姓氏姓名 的方法,發現皆為
{$address['firstname']} {$address['lastname']}
我猜測應該無法透過設定的方式來修改輸出格式
 
因此我用了一個在註冊頁面中做弊的方式:
1.我先註解輸入姓氏的欄位,讓它不會出現在註冊頁面上,目的是為了讓使用者只輸入姓名firstname就好
<!--
<div class="required form-group">
<label for="customer_lastname">{l s='Last name'} <sup>*</sup></label>
<input onkeyup="$('#lastname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" />
</div>
-->
 
2.拉出原本輸入姓氏欄位的程式碼,進行修改
<input onkeyup="$('#lastname').val(this.value);" type="text" class="is_required validate form-control" data-validate="isName" id="customer_lastname" name="customer_lastname" value="{if isset($smarty.post.customer_lastname)}{$smarty.post.customer_lastname}{/if}" />
 
3.刪除註冊頁面檢查必填欄位的程式碼,並讓value塞入空白值,目的是為了傳到PHP驗證時可以通過檢查。
 
<input onkeyup="$('#lastname').val(this.value);" type="hidden" class="is_required validate form-control" data-validate="isName" id="customer_lastname" name="customer_lastname" value=" " />

 

以上方法或許不是最好,但會是解決這問題的方案之一

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...