我如何选择使用Jscript ELSE php验证 [英] How could I choose between using Jscript ELSE php validation

查看:84
本文介绍了我如何选择使用Jscript ELSE php验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我如何选择使用JavaScript(如果不可用)在这个例子中使用PHP?

我有一个HTML选择控件有两个onchange方法。第一个调用JavaScript验证( getValues ();),第二个调用服务器验证( this.form.submit ();)。

Hi all,
how can I choose to use JavaScript (and if not available) use PHP in this example?
I have an HTML select control that has two onchange methods. The first one calls a JavaScript validation (getValues();) and the second calls for server validation (this.form.submit();).

展开 | 选择 | Wrap | 行号

推荐答案

不要这样做。

总是使用服务器端验证,无论是否有客户端验证。
don?t do that.

always use server-side validation regardless if there was client side validation or not.


我同意,始终使用服务器端验证。但是如果你愿意的话,两个都做,所以用户可以在提交前获得即时反馈。
I agree, always use server side validation. But if you want, do both, so the user can have instant feedback before submission.


好的,我不认为我正确解释了它。它不是真正的验证,而只是为了使表单更具互动性。让我们称之为功能。

我已经拥有服务器端功能和javascript功能。我想做的就是在两者之间做出选择。如果用户已禁用Jscript,那么使用服务器端代码来完成工作,否则让Jscript更快地完成。

我有办法吗?
ok, I dont think I explained it correctly. Its not really validation but rather just to make the form more interactive. Lets call it functionality.
I already have server side functionality and javascript functionality. All I want to do is choose between the two. If the user has Jscript disabled then use serverside code to do the job else let Jscript do it quicker.
Is there a way I could?


这篇关于我如何选择使用Jscript ELSE php验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆