2012-01-20 34 views
0

我遇到了表单有问题 - 我似乎无法选择密码字段。实现它的唯一方法是使用Tab键前往现场。这仅影响webkit浏览器。Webkit - 无法选择字段

这是HTML表单

public function form() 
{ 
    global $ACL_LANG; 
    $htmlForm = '<form id="frmlogin"><fieldset><label><dl><dt>'; 
    switch (LOGIN_METHOD) { 
     case 'both' : 
      $htmlForm .= $ACL_LANG ['USERNAME'] . '/' . $ACL_LANG ['EMAIL']; 
      break; 
     case 'email' : 
      $htmlForm .= $ACL_LANG ['EMAIL']; 
      break; 
     default : 
      $htmlForm .= $ACL_LANG ['USERNAME']; 
      break; 
    } 
    $htmlForm .= '</label></dt>' . '<dd><input type="text" name="u" id="u" class="large" /></dd><dt>' . '<label>' . $ACL_LANG ['PASSWORD'] . '</label></dt>' . '<dd><input type="password" name="p" id="p" class="large" /></dd>' . '<input type="hidden" name="uri" id="uri" value="' . $_SERVER['REQUEST_URI'] . '" /></dl></fieldset><button type="submit" style="float:right;">Log in</button></form>'; 
    return $htmlForm; 
} 

这是JavaScript管理页面

$.getJSON(postFile, function(data) { 

    if (data.status == true) { 
     // status is authorized 
     if (autoRedir) { 
      $(authentication).hide(); 
      $(authenticating).hide().html('Authentication success.').fadeIn('fast', function() { 
       window.location = data.url; 
      }); 
     } else { 
      $(waitId).fadeOut('slow', 
       function() { 
        $(wrapperId).html(data.message).slideDown(); 
       }).html(); 
     } 
    } else { 
     // show form 
     $(wrapperId).html(data.message).fadeIn('0', function() { 
      // hide message 
      $(waitId).fadeOut('fast', 
       function() { 

        //*/ submit handler 
        $("#frmlogin").submit(function() { 
         // loading 
         $(waitId).hide(); 
         $(notificationerror).hide(); 
         $(notification).hide(); 
         $(authentication).fadeIn(); 
         $(wrapperId).hide(); 

         var _u = $(userId).val(); // form user 
         var _p = $(passId).val(); // form id 
         var _uri = $(uri).val(); // form id 

         //@ valid user (modify as needed) 
         if (_u.length < 4) { 
          $(authentication).hide(); 
          $(notificationerror).html(jsErrMsg).fadeIn('fast', function() { 
          }); 
          $(wrapperId).show(); 
         } 
         else { 
          //@ valid password (modify as needed) 
          if (_p.length < 4) { 
           $(authentication).hide(); 
           $(waitId).html(notificationerror).fadeIn('fast', function() { 
            $(passId).focus(); 
           }); 
          } 
          else { 
           $.post(postFile, { u: _u, p: _p, uri: _uri }, function(data) { 
             if (data.status == true) { 
              if (autoRedir) { 
               $(authentication).html('Setting session.').fadeIn(); 
               setTimeout("",2000); 
               $(authentication).html('Authentication success.').fadeIn('fast', function() { 
                window.location = data.url; 
               }); 
              } else { 
               $(waitId).fadeOut('slow', 
                function() { 
                 $(wrapperId).slideUp('slow', function() { 
                  $(this).html(data.message).slideDown(); 
                 }); 
                }).html(); 
              } 
             } else { 
              $(wrapperId).show(); 
              $(notification).show(); 
              $(authentication).hide(); 
              $(notificationerror).html(data.message).fadeIn(function() { 
              }); 
             } 
            } 
            , 'json'); 
          } 
         } 
         return false; 
        }); 
        //*/ 
       }).html(); 
     }); 

    } 

}); 

任何想法?

+0

不要像这样建立表格;使用模板。 –

+0

对'setTimeout(“”,2000)'的调用不会有用。 – Pointy

+0

@Pointy,我已将其删除。 – bear

回答

0

听起来像是如果你可以选择到该字段,但无法点击它,有一些东西覆盖它...因此阻碍。

如果您在Google Chrome中打开该网站,请右键点击您尝试访问输入框但被阻止的位置。选择'检查元素',它应该突出显示鼠标右键单击的元素。

您也可以将鼠标悬停在检查器中的元素上以在页面上突出显示它们。这可能会揭示阻碍它的因素。