我试图在html5表单字段中更改错误消息的语言.
我有这个代码:
<input type="text" name="company_name" oninvalid="setCustomValidity('Lütfen i?aretli yerleri doldurunuz')" required />
Run Code Online (Sandbox Code Playgroud)
但是在提交时,即使字段不是空白,我仍然会收到错误消息.
我试过了 <input type="text" name="company_name" setCustomValidity('Lütfen i?aretli yerleri doldurunuz') required />
但随后显示英文消息.任何人都知道如何在其他语言上显示错误消息?
问候,卓然
我在jQuery代码中有以下函数:
btnLogin.on('click', function(e,errorMessage){
console.log('my message' + errorMessage);
e.preventDefault();
return $.ajax({
type: 'POST',
url: 'loginCheck',
data: $(formLogin).serialize(),
dataType: 'json'
}).promise();
console.log('my message' + errorMessage);
});
Run Code Online (Sandbox Code Playgroud)
我在做什么:我正在尝试console.log错误消息.如果console.log行在ajax函数之上,我将得到未定义,如果console.log低于它,则没有任何内容.
谁能告诉我如何获得在这个或另一个新函数中显示的errorMessage的值?
此外,任何关于使用Ajax检查php登录表单的链接都将受到高度赞赏
问候,卓然
嗨,我有以下页面:
<input type="checkbox" name="fruit1" id="1" class="box">Banana<br /><br />
<input type="checkbox" name="fruit2" id="2" class="box">Cherry<br /><br />
<input type="checkbox" name="fruit3" id="3" class="box">Strawberry<br /><br />
<input type="checkbox" name="fruit4" id="4" class="box">Orange<br /><br />
<input type="checkbox" name="fruit5" id="5" class="box">Peach<br /><br />
<input type="button" id="groupdelete" value="clickme"><br />
Run Code Online (Sandbox Code Playgroud)
$(document).ready(function(){
$('#groupdelete').on('click', function(){
var names = [];
$('input:checked').each(function() {
names.push($('input:checked').attr("name") + $('input:checked').attr('id'));
});
console.log(names);
})
})
Run Code Online (Sandbox Code Playgroud)
我想要做的是以下内容:
在数组中添加选中的复选框.之后,我希望能够传递php变量中的值.
当我现在执行代码时,我得到的结果如下:
["fruit22","fruit22","fruit22"]
任何帮助将深表感谢.
此致,Zoreli
我有php应用程序必须部分重写,因为客户要求有SEO frendly urls.
我的链接如下:
www.mysite.com/articles_en.php?artid=89,我必须在这里更改网址:
www.mysite.com/articleTitle
然后我有这个网址:
应该成为www.mysite.com/halls.php?fairid=65
www.mysite.com/fairname
并且www.mysite.com/companies.php?fairid=65&hallid=23应该成为
www.mysite.com/fairname/hallname
你明白了.
我需要帮助这个方法.在展览会,大厅和文章的表格中,在表格中创建一个以别名命名的字段然后尝试重写网址是不是一个好主意?任何人都可以帮助我完成如何创建此脚本的步骤,或指向我更好的方法?
我擅长php,但对正则表达式并不擅长,所以我会迷失在.htaccess部分.
任何帮助将深表感谢.
此致,佐兰
我正在使用Codeigniter分页,但遇到了问题.
点击更改URL,如限制更新,例如displayAllUsers/10到displayAllUsers/15,但结果保持不变.
这是我的控制器:
public function displayAllUsers()
{
$this->load->model('backOfficeUsersModel');
$data['loggedUser'] = $this->backOfficeUsersModel->get_by('username', $this->session->userdata('username'), FALSE,TRUE);
$this->db->order_by('userid');
$limit = 5; // this works, I have 5 records displayed on the page
$offset = 3;
$this->db->limit($limit);
$this->db->offset($offset);
$data['users'] = $this->backOfficeUsersModel->get();
// line bellow, prints correct result, 17 records total in database;
$totalresults = $this->db->get('back_office_users')->num_rows();
$this->load->library('pagination');
$config['base_url'] = site_url('/backOfficeUsers/displayAllUsers');
$config['total_rows'] = $totalresults;
$config['per_page'] = 5;
$config['uri_segment'] = 3;
$this->pagination->initialize($config);
$data['main_content'] = 'users';
$data['title'] = 'Back Office Users';
$errorMessage = FALSE;
$this->load->vars($data,$errorMessage);
$this->load->view('backOffice/template');
} // end …Run Code Online (Sandbox Code Playgroud) jquery ×2
.htaccess ×1
ajax ×1
codeigniter ×1
forms ×1
html5 ×1
javascript ×1
pagination ×1
php ×1
seo ×1