zoukankan      html  css  js  c++  java
  • form表单无刷新提交文件(iframe)

    先看一段代码(PHP例子)

    1、表单代码(form.html):

    <iframe name="testIframeName" style="display:none;"></iframe>  
    <form target="testIframeName" method="post" action="formAction.php">  
    <input type="text" name="username"/>  
    <input type="password" name="password"/>  
    <input type="submit" value=" 提 交 " />  
    </form>

    2、action代码(formAction.php):

    <?php  
    echo "<script>top.window.alert('test....');</script>";  
    ?>  

    详见target说明:

    属性描述
    accept MIME_type HTML 5 中不支持。
    accept-charset charset_list 规定服务器可处理的表单数据字符集。
    action URL 规定当提交表单时向何处发送表单数据。
    autocomplete
    • on
    • off
    规定是否启用表单的自动完成功能。
    enctype 见说明 规定在发送表单数据之前如何对其进行编码。
    method
    • get
    • post
    规定用于发送 form-data 的 HTTP 方法。
    name form_name 规定表单的名称。
    novalidate novalidate 如果使用该属性,则提交表单时不进行验证。
    target
    • _blank
    • _self
    • _parent
    • _top
    • framename
    规定在何处打开 action URL。

    说明

    参考:http://www.w3school.com.cn/tags/tag_form.asp

  • 相关阅读:
    C语言作业9
    C语言作业8
    学习体会
    C语言作业7
    C语言作业6
    C语言作业5
    C语言作业4
    C语言作业3
    丛铭俣 160809324 (作业12)
    丛铭俣 160809324 (作业10)
  • 原文地址:https://www.cnblogs.com/cssfirefly/p/5610673.html
Copyright © 2011-2022 走看看