English 中文(简体)
重新定位功能显示数据的形式
原标题:reset Function displayed data in form
     function my_fav_quote_show_optin_form() {  

        if (!empty($_POST[ my_fav_quote_email ])) {

            my_fav_quote_opt_in();
        }
            $out2 =   ;

            $out =  <form action="" method="post" id="requestQuote"> ;
            $out .=  <table style="padding="0px" width="40px"> ;
            $out .=  <tr><td style="vertical-align: middle;">Message:<br></td><td><textarea placeholder=""  name="my_fav_quote_message" id="my_fav_quote_message"></textarea></td></tr> ;
            $out .=   ;


            $out .= <tr><td colspan="2"> ;
            if ( function_exists(  my_fav_quote_display  ) ){
                $out .= my_fav_quote_display();
            }



            if ( function_exists(  my_fav_quote_display3  ) ){
                $out .= my_fav_quote_display3();
            }


            $out .= </td></tr> ;
            $out .=  <tr><td colspan=2 align=center><input type="submit" value="Request Quote" onclick="return chk_validation()" style="background-color:#000;color:#FFF;padding:5px;margin-top:10px;border:none;cursor:pointer;"/>  <input type="button" onclick="formReset()" value="Reset form" /></td></tr> ;

            $out .= </table></form> ;
            echo $out;
            ?>
                <script language="javascript" type="text/javascript">
                    function formReset()
    {
    document.getElementById("requestQuote").reset();
    }
    //<![CDATA[
                    function validate_email(field,alerttxt)
                    {

                      apos=field.indexOf("@");
                    // alert(apos);
                      dotpos=field.lastIndexOf(".");
                       //alert(dotpos);
                      if (apos<1||dotpos-apos<2)
                        { return false;}
                      else {return true;}

                    }
                    function chk_validation()
                    {
                        if(document.getElementById("my_fav_quote_name") && document.getElementById("my_fav_quote_name").value ==   )
                        {
                            alert("Please Enter Name");
                            document.getElementById("my_fav_quote_name").focus();
                            return false;
                        }

                        if(document.getElementById("my_fav_quote_email").value ==   )
                        {
                            alert("Please Enter Email");
                            document.getElementById("my_fav_quote_email").focus();
                            return false;
                        }
                        else
                        {

                        //alert(validate_email(document.getElementById("my_fav_quote_email").value,"Not a valid e-mail address!");
                            if (validate_email(document.getElementById("my_fav_quote_email").value,"Please enter valid e-mail address!")==false)                        {
                            alert("Please enter valid e-mail address!");
                            document.getElementById("my_fav_quote_email").focus();
                            return false;
                            }
                        }
                        if(document.getElementById("security_code").value ==   )
                        {
                            alert("Please Enter Security Code");
                            document.getElementById("security_code").focus();
                            return false;
                        }
                        if(document.getElementById("quotes").value ==   )
                        {
                            alert("Please add atleast one request quote");
                            document.getElementById("quotes").focus();
                            return false;
                        }
                        //return true;
                    }



                    //]]>

                </script>
    <?php

    } 

这是在php中写成的“快乐”一词的一种形式,即需要添加一个 re子,由他自己尝试。

function formReset()
    {
    document.getElementById("requestQuote").reset();
    } 

但是,这并不奏效。

http://plugins.svn.wordpress.org/quote-cart/trunk/quote-cart.php

I want to reset the form when the user click on reset button all the data that is displayed should be removed from all the feilds and from from (the two functions my_fav_quote_display3 &the my_fav_quote_display & ) which was not actually happening.

为什么我能够这样做?

最佳回答

你只能重新制定一种形式,重新分类。

<input type="reset" value="Reset">
问题回答

你的问候成功地要求改写形式,这正是你想要做的。

问题在于,有不止一种明确的形式: 你似乎正在使用一种金字,它既规定了<条码>my_fav_quote_display()的功能。 确实没有任何东西可以说明这些方法是什么,或者,如果贵国数据库中有任何领域被本金所利用,因为你没有显示任何相关的法典(甚至提到原始名称)。

为了永久消失,您需要看看一下您的原样子,并找到my_fay_quote_display()和my_fav_quotes_display3()的工作,如果有一个数据领域,你可以重新打造,或者用某种其他方法阻止其显示。

<input type="button" onclick="formReset()" value="Reset form" />

紫外线已经重新set起,你急切需要 j印。

<input type="reset" value="Reset form" />

如果你真的用 j刀割大麻,你可以做这样的事情:

<form name="myform"></form>
<script> document.myform.reset() </script>

至少对我来说,使用名称标签而不是id,而且应该工作。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签