2016-06-13 50 views
0

設定數據驗證-REQ-PARAMS當我嘗試設置多個參數錯誤使用formvalidator平臺

SyntaxError: JSON.parse: end of data while reading object contents at line 1 column 2 of the JSON data

我下面的formvalidator.net說明我得到這個錯誤。我正在使用jquery-2.2.2。這裏是我的代碼

<?php 
    $json = json_encode(array('user'=>$user->get('ID'))); 
?> 
<p> 
    <strong>E-mail:</strong> 
    <input type="email" name="check-email" data-validation="server" data-validation-url="/validate-form-input.php" data-validation-param-name="email" data-validation-req-params="<?php echo $json ?>" /> 
</p> 

錯誤:

enter image description here

預先感謝您這麼多的回答!

+0

我不小心撞到enterbutton。我已經編輯過它。 –

+0

好的。只是供參考對我們來說更好(對你而言更容易)只需將代碼複製並粘貼到問題中,而不是截取並裁剪它。我已經爲你更新了。 –

+0

謝謝你這樣做,我很難粘貼它,所以我只是拍了一個屏幕截圖。 –

回答