dousou3027 2009-08-06 21:20
浏览 51

使用php进行多页面表单验证

This is my first post, so be kind ; )

I'm wanting to create a multi page form with php.

The form will spread over 3 pages, each page will need to validate on the data entered into the form on the client (using jquery validation) and if javascript is disabled, on the server, where error messages need to be displayed beside the related form field.

Upon validation, the data needs to be passed to the next page in the form, preferable using session variables.

The main problem I'm having is that most validation scripts now leave the action="" as being self referring to the current page, and as such post variables cannot be passed onto a different page in the chain of forms.

I want to have a validation script that will validate, and then post to a new page upon clicking the submit button.

Thanks

Peter

  • 写回答

4条回答 默认 最新

  • dongwei1234 2009-08-06 21:24
    关注

    You don't have to post to the next page.

    You can validate the form fields on the current page, store them in a session, then use a header("location: nextPage.php"); exit(0); redirect to go to the next page.

    评论

报告相同问题?

悬赏问题

  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch