Changeset 610

Show
Ignore:
Timestamp:
10/13/07 22:56:23 (1 year ago)
Author:
laurentj
Message:

fixed bug #301: jforms, deprecated name attribut should not be generated
fixed bug #302: jforms html: bad value in method attribute

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0beta3.x/lib/jelix-www/js/jforms.js

    r609 r610  
    5151 
    5252    verifyForm : function(frmElt){ 
    53         var f = this._forms[frmElt.name]; 
     53        var f = this._forms[frmElt.getAttribute('id')]; 
    5454        var msg = ''; 
    5555        var valid = true; 
  • branches/1.0beta3.x/lib/jelix-www/js/jforms.js

    r609 r610  
    5151 
    5252    verifyForm : function(frmElt){ 
    53         var f = this._forms[frmElt.name]; 
     53        var f = this._forms[frmElt.getAttribute('id')]; 
    5454        var msg = ''; 
    5555        var valid = true; 
  • branches/1.0beta3.x/lib/jelix/forms/jFormsBuilderBase.class.php

    r607 r610  
    108108    public function outputHeader($params){ 
    109109        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    110         echo '<form action="',$url->scriptName,$url->pathInfo,'" method="POST" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
     110        echo '<form action="',$url->scriptName,$url->pathInfo,'" method="post" id="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
    111111        if($this->_form->hasUpload()) 
    112112            echo ' enctype="multipart/form-data">'; 
  • branches/1.0beta3.x/lib/jelix/forms/jFormsBuilderBase.class.php

    r607 r610  
    108108    public function outputHeader($params){ 
    109109        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    110         echo '<form action="',$url->scriptName,$url->pathInfo,'" method="POST" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
     110        echo '<form action="',$url->scriptName,$url->pathInfo,'" method="post" id="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
    111111        if($this->_form->hasUpload()) 
    112112            echo ' enctype="multipart/form-data">'; 
  • branches/1.0beta3.x/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php

    r609 r610  
    8080        $builder->outputHeader(array('','')); 
    8181        $out = ob_get_clean(); 
    82         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
     82        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="post" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
    8383<input type="hidden" name="action" value="urlsig_url1"/> 
    8484</div><script type="text/javascript">  
     
    9494        $builder->outputHeader(array('','')); 
    9595        $out = ob_get_clean(); 
    96         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
     96        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="post" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
    9797<input type="hidden" name="module" value="jelix_tests"/> 
    9898<input type="hidden" name="action" value="urlsig_url1"/> 
  • branches/1.0beta3.x/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php

    r609 r610  
    8080        $builder->outputHeader(array('','')); 
    8181        $out = ob_get_clean(); 
    82         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
     82        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="post" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
    8383<input type="hidden" name="action" value="urlsig_url1"/> 
    8484</div><script type="text/javascript">  
     
    9494        $builder->outputHeader(array('','')); 
    9595        $out = ob_get_clean(); 
    96         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
     96        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="post" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
    9797<input type="hidden" name="module" value="jelix_tests"/> 
    9898<input type="hidden" name="action" value="urlsig_url1"/> 
  • trunk/lib/jelix-www/js/jforms.js

    r609 r610  
    5151 
    5252    verifyForm : function(frmElt){ 
    53         var f = this._forms[frmElt.name]; 
     53        var f = this._forms[frmElt.getAttribute('id')]; 
    5454        var msg = ''; 
    5555        var valid = true; 
  • trunk/lib/jelix-www/js/jforms.js

    r609 r610  
    5151 
    5252    verifyForm : function(frmElt){ 
    53         var f = this._forms[frmElt.name]; 
     53        var f = this._forms[frmElt.getAttribute('id')]; 
    5454        var msg = ''; 
    5555        var valid = true; 
  • trunk/lib/jelix/forms/jFormsBuilderBase.class.php

    r608 r610  
    109109    public function outputHeader($params){ 
    110110        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    111         echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params[2].'" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
     111        echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params[2].'" id="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
    112112        if($this->_form->hasUpload()) 
    113113            echo ' enctype="multipart/form-data">'; 
  • trunk/lib/jelix/forms/jFormsBuilderBase.class.php

    r608 r610  
    109109    public function outputHeader($params){ 
    110110        $url = jUrl::get($this->_action, $this->_actionParams, 2); // retourne le jurl correspondant 
    111         echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params[2].'" name="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
     111        echo '<form action="',$url->scriptName,$url->pathInfo,'" method="'.$params[2].'" id="', $this->_name,'" onsubmit="return jForms.verifyForm(this)"'; 
    112112        if($this->_form->hasUpload()) 
    113113            echo ' enctype="multipart/form-data">'; 
  • trunk/lib/jelix/plugins/tpl/html/block.form.php

    r608 r610  
    5353        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    5454 
    55     $method = strtoupper(isset($param[5])?$param[5]:'POST'); 
    56     if($method!='GET' && $method!='POST') 
    57         $method='POST'; 
     55    $method = strtolower(isset($param[5])?$param[5]:'post'); 
     56    if($method!='get' && $method!='post') 
     57        $method='post'; 
    5858 
    5959    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
  • trunk/lib/jelix/plugins/tpl/html/block.form.php

    r608 r610  
    5353        $helpdecorator = "'jFormsHelpDecoratorAlert'"; 
    5454 
    55     $method = strtoupper(isset($param[5])?$param[5]:'POST'); 
    56     if($method!='GET' && $method!='POST') 
    57         $method='POST'; 
     55    $method = strtolower(isset($param[5])?$param[5]:'post'); 
     56    if($method!='get' && $method!='post') 
     57        $method='post'; 
    5858 
    5959    $content = ' $t->_privateVars[\'__form\'] = '.$param[0].'; 
  • trunk/lib/jelix/plugins/tpl/html/function.formfull.php

    r608 r610  
    2020 */ 
    2121function jtpl_function_html_formfull($tpl, $form, $action, $params=array(),  
    22         $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert', $method='POST') 
     22        $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert', $method='post') 
    2323{ 
    2424 
  • trunk/lib/jelix/plugins/tpl/html/function.formfull.php

    r608 r610  
    2020 */ 
    2121function jtpl_function_html_formfull($tpl, $form, $action, $params=array(),  
    22         $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert', $method='POST') 
     22        $errDecorator='jFormsErrorDecoratorAlert', $helpDecorator='jFormsHelpDecoratorAlert', $method='post') 
    2323{ 
    2424 
  • trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php

    r608 r610  
    7878        $formname = $builder->getName(); 
    7979        ob_start(); 
    80         $builder->outputHeader(array('','','POST')); 
     80        $builder->outputHeader(array('','','post')); 
    8181        $out = ob_get_clean(); 
    82         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
     82        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="post" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
    8383<input type="hidden" name="action" value="urlsig_url1"/> 
    8484</div><script type="text/javascript">  
     
    9292        $formname = $builder->getName(); 
    9393        ob_start(); 
    94         $builder->outputHeader(array('','','GET')); 
     94        $builder->outputHeader(array('','','get')); 
    9595        $out = ob_get_clean(); 
    96         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="GET" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
     96        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="get" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
    9797<input type="hidden" name="module" value="jelix_tests"/> 
    9898<input type="hidden" name="action" value="urlsig_url1"/> 
  • trunk/testapp/modules/jelix_tests/tests/jforms.htmlbuilder.html.php

    r608 r610  
    7878        $formname = $builder->getName(); 
    7979        ob_start(); 
    80         $builder->outputHeader(array('','','POST')); 
     80        $builder->outputHeader(array('','','post')); 
    8181        $out = ob_get_clean(); 
    82         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="POST" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
     82        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="post" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="module" value="jelix_tests"/> 
    8383<input type="hidden" name="action" value="urlsig_url1"/> 
    8484</div><script type="text/javascript">  
     
    9292        $formname = $builder->getName(); 
    9393        ob_start(); 
    94         $builder->outputHeader(array('','','GET')); 
     94        $builder->outputHeader(array('','','get')); 
    9595        $out = ob_get_clean(); 
    96         $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="GET" name="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
     96        $result ='<form action="'.$GLOBALS['gJConfig']->urlengine['basePath'].'index.php" method="get" id="'.$formname.'" onsubmit="return jForms.verifyForm(this)"><div><input type="hidden" name="foo" value="b&gt;ar"/> 
    9797<input type="hidden" name="module" value="jelix_tests"/> 
    9898<input type="hidden" name="action" value="urlsig_url1"/> 
Download in other formats: Unified Diff Zip Archive