douchensou6495 2012-04-10 19:49
浏览 55

推荐jQuery 1.6.4 ajax PHP表单邮件脚本

Recommend jQuery 1.6.4 ajax php form mail scripts?

I've been searching for script that fit jQuery 1.6.4 ajax php that I can use. Quite a lot that I've come across is part of script that is taking alot of time to put together. Is there anything that is clearly descriptive from start to finish. A form with check.php script too if that is possible.

I'm using a jQuery 1.6.4 form mail using ajax post with php script. A jQuery error message if a single input field is not filled.

To register a ID number and select module subject 1 or subject 2 with and submit. This will go to subjectData.mysql database

I've already designed a form mail using a jQuery 1.6.4.

<div class="field"><!-- Start Login--> 
     <form action="register.php" method="post" class="register">
         <fieldset class="ui-widget ui-widget-content">
         <label for="textinput1"><strong>Log in to register a module</strong></label>
         <input id="textinput1" placeholder="people number" type="text"  /></fieldset>
         <fieldset data-role="controlgroup">
         <input id="textinput2" placeholder="Password" type="password" /></fieldset> 
         <fieldset data-role="controlgroup" data-mini="true">
         <input type="radio" name="radio-choice-1" id="radio-mini-1" value="modNo1" checked="checked" />

         <label for="radio-mini-1">subject 1</label>
         <input type="radio" name="radio-choice-1" id="radio-mini-2" value="modNo2"  />
         <label for="radio-mini-2">subject 2</label></fieldset>
         <input type="submit" data-theme="a" name="submit" value="Register" />
         <button data-theme="b" id="reset" type="reset">Reset</button>
     </form>
</div>

         <!-- END Login-->
</div>
  • 写回答

1条回答 默认 最新

  • dsjklb0205 2012-09-13 14:23
    关注

    I agree with prodigitalson, you need to know some php to write the code you need and build the response with php for the jquery ajax to receive it and do some javascript magic according to that response. But you have to code that custom bit.

    The form will most likely send the POST data to check.php, where it will all be processed, and it will then build a json encoded respopnse to reply to the page with the form. You need then some javascript code on that page to:

    1. Prevent default operation of the send button and bind to that click event the form submission with ajax.
    2. Build the php code on check.php to do something with the POST data ($_POST array in PHP) and prepare a json encoded response (build an array and when done, echo the output of json_encodeing it).
    3. build the javascript code to handle the ajax response from check.php

    Some sample code on how to respond with php to a jquery ajax request here

    评论

报告相同问题?

悬赏问题

  • ¥15 Jenkins+k8s部署slave节点offline
  • ¥15 微信小游戏反编译后,出现找不到分包的情况
  • ¥15 如何实现从tello无人机上获取实时传输的视频流,然后将获取的视频通过yolov5进行检测
  • ¥15 WPF使用Canvas绘制矢量图问题
  • ¥15 用三极管设计一个单管共射放大电路
  • ¥15 孟德尔随机化r语言运行问题
  • ¥15 pyinstaller编译的时候出现No module named 'imp'
  • ¥15 nirs_kit中打码怎么看(打码文件是csv格式)
  • ¥15 怎么把多于硬盘空间放到根目录下
  • ¥15 Matlab问题解答有两个问题