将 PHP 值传递给 jQuery 中的第三方脚本
我使用与上述问题中提到的相同的第三方脚本进行表单验证 现在我们在名为 jquery.validationEngine-en.js 的第三方脚本中有一个文件。所以我的 html 中有一个字段,称为
<input type="text" id ="test1" value ="" class ="ajax[optional,ajaxcode]">
我们以这种方式定义的 jquery.validationEngine-en.js 中的字段
"ajaxcode":{
"file":"get_custcode.php?citycode=",
"alertText":"code is already taken",
"alertTextOk":"",
"alertTextLoad":"* Checking..."
},
所以我的问题是如何我是否要通过一些动态值(PHP)传递城市代码(参数),这在服务器端脚本(PHP)中是非常强制的,以确保该城市中不存在custcode。但我无法通过城市代码。这是我尝试过的各种事情 用于传递值
"file":"get_custcode.php?citycode="+<? echo $_REQUEST['citycde']?>,
"file":"get_custcode.php?citycode=<? echo $_REQUEST['citycde']?>",
how is this jquery app validating the username? (3rd party script)
Iam using the same third party script for form validation that was mentioned in the above question
.Now we have file in the third party script known as jquery.validationEngine-en.js .so i have a field in my html known as
<input type="text" id ="test1" value ="" class ="ajax[optional,ajaxcode]">
in the jquery.validationEngine-en.js we have defined in this way
"ajaxcode":{
"file":"get_custcode.php?citycode=",
"alertText":"code is already taken",
"alertTextOk":"",
"alertTextLoad":"* Checking..."
},
So my problem is How do i pass the citycode (parameter ) with some dynamic value(PHP) which is very much mandatory at the server side script (PHP)inorder to make sure that custcode dowsnot exist in that city. But iam Unable to pass the city code. here are the various things i have tried
for passing the value
"file":"get_custcode.php?citycode="+<? echo $_REQUEST['citycde']?>,
"file":"get_custcode.php?citycode=<? echo $_REQUEST['citycde']?>",
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如何将城市的值放入隐藏表单中并让 jQuery 从中获取值以进行验证:
HTML
Js 脚本
How about placing the value of the city inside a hidden form and let jQuery get the value out of it for the validation:
HTML
Js script