小编awo*_*gCM的帖子

如何使用这个简单的jQuery禁用HTML文本字段?

我有这个简单的jQuery代码来测试.

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
      $("button").click(function(){
          $("text").attr("disabled","");
      });
    });
</script>
</head>
<body>
<input type="text">
<br />
<button>Set the textfield disabled</button>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

基本上HTML页面带有一个简单的按钮和文本字段.我点击按钮时只想禁用输入字段.但它不起作用???

(PS:这段代码来自w3schools.com网站,只是为了测试jQuery的强大功能)

html jquery textfield

10
推荐指数
1
解决办法
3万
查看次数

如何在VBA中隐藏按钮控件

还有人在这里还在编程VBA吗?

我正试图让这段代码工作

Private Sub button3_click()

    'hide main buttons
    button1.Visible = False
    button2.Visible = False
    button3.Visible = False

    'show submenu buttons
    button4.Visible = True;
    button5.Visible = True;

End Sub
Run Code Online (Sandbox Code Playgroud)

我要做的基本上是我有一个主窗体,有5个主按钮控件.其中2个在启动时隐藏.因此,当我单击按钮3时,我想隐藏前3个主按钮,并"取消隐藏"其他两个按钮.尝试执行此事件时,出现错误

" 运行时错误2165 - 您无法隐藏具有焦点的控件 ".

以前有人遇到过这方面的编程吗?我确信这是可行的.我只是不明白这里出了什么问题......

ms-access onclick button access-vba

8
推荐指数
1
解决办法
5万
查看次数

Rails Join Model选择联合列

我有以下三个模型加入关系

class Book < ActiveRecord::Base
  has_many :contributions, :dependent => :destroy
  has_many :contributors, :through => :contributions
end

class Contributor < ActiveRecord::Base
  has_many :contributions, :dependent => :destroy
  has_many :books, :through => :contributions do
    def this_is_my_contribution(book, join_attrs) 
      Contribution.with_scope(:create => join_attrs) {self << book}
    end
  end
 end

class Contribution < ActiveRecord::Base
  belongs_to :book
  belongs_to :contributor
end
Run Code Online (Sandbox Code Playgroud)

然后在将记录插入Contribution连接模型后,我决定对此模型进行查询以检索所有书籍和贡献者名称作为结果查询,如下面的SQL等效项

SELECT Contributions.*, Contributors.name, Books.name from Contributions 
INNER JOIN Contributors ON Contributors.id = Contributions.contributors_id 
INNER JOIN Books ON Books.id = Contributions.books_id
Run Code Online (Sandbox Code Playgroud)

但在irb控制台中,当我写这篇文章时,

Contribution.joins(:contributor, :book).select("contributors.name, books.name,
  contributions.*")   
Run Code Online (Sandbox Code Playgroud)

我得到以下输出

 Contribution …
Run Code Online (Sandbox Code Playgroud)

mysql sql sql-server join ruby-on-rails

7
推荐指数
1
解决办法
6022
查看次数

选中CSS样式复选框 - 不工作

我有以下静态html文件,我花时间为我们的客户建立一个CMS Web应用程序站点.

http://cms.tmadev.com.au/usergroup.html

在中间部分,有一个垂直的复选框数组(我用它来设计它),我跟着许多在线教程,这些教程引导我使用这个网站链接.

http://csscheckbox.com/

我下载源代码教程,理解它,复制css代码,根据我的客户要求定制我的更改.

一切看起来都很好 - 除了试图勾选复选框.

什么都没发生!

单击时不会选中该复选框!

我无法弄清楚为什么它不起作用,因为它应该像教程一样.

有人可以告诉我我做错了什么吗?

这是我的代码.

input[type=checkbox].input-checkbox{
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0,0,0,0);
    margin: -1px;
    padding: 0;
    border: 0;
}


input[type=checkbox].input-checkbox + label.input-label{
    border: 2px solid #58585A;
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 15px;
    background-repeat: no-repeat;
    font-size:15px;
    vertical-align: middle;
    cursor: pointer;
}

input[type=checkbox].input-checkbox:checked + label.input-label{
    background-position: 0 -20px;   
}

.input-label{
    background-image: url('/images/tickbox.png');
}
Run Code Online (Sandbox Code Playgroud)

非常感谢!

html css checkbox

6
推荐指数
1
解决办法
2万
查看次数

Ruby on Windows:无法安装mysql2 gem - 无法构建gem原生扩展

我试着在这里那里关注帖子

但是,我远远没有达到这个问题的真实答案.

还有什么我在这里不见了吗?

d:\Projects\Ruby\cms>gem install mysql2 --platform=ruby -- '--with-mysql-dir="C:\mysql-connector-c-6.1.3-winx64"'
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.

    C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb --with-mysql-dir="C:\mysql-connector-c-6.1.3-winx64"
checking for ruby/thread.h... no
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
-----
Using --with-mysql-dir=C:\mysql-connector-c-6.1.3-winx64
-----
checking for main() in -llibmysql... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking …
Run Code Online (Sandbox Code Playgroud)

ruby windows ruby-on-rails

4
推荐指数
1
解决办法
1981
查看次数

对使用Paperclip上传处理AJAX文件的Rails 4感到困惑

在我的html视图代码中,我有两种不同的形式,但共享相同的id名称

<div class="editcompanyprofile_tab" style="display:block;">
<div class="inputfield-container clearfix">
  <%= form_for(@company, remote: true) do |f| %>
  <div class="inputfield_row clearfix">
    <div class="field" style ="width: 125px;">
      <%= f.label :name, "Company Name" %>
    </div>
    <div class="inputfield">
      <%= f.text_field :name, :style => "width: 259px;" %>
    </div>
  </div>
  <div class="inputfield_row clearfix">
    <div class="field" style ="width: 125px;">
      <%= f.label :firstname, "First Name" %>
    </div>
    <div class="inputfield">
      <%= f.text_field :firstname, :style =>"width: 259px;" %>
    </div>
  </div>
  <div class="inputfield_row clearfix">
    <div class="field" style ="width: 125px;">
      <%= f.label :lastname, …
Run Code Online (Sandbox Code Playgroud)

html javascript ajax jquery ruby-on-rails

3
推荐指数
1
解决办法
3280
查看次数

调用未定义的函数'init_set'

当尝试以编程方式更改php.ini配置设置时,是否有人知道如何调试"调用未定义函数init_set"?我只是试图在代码中调用init_set函数,而apache无法在该行处理它.

我最近在我的Windows XP机器上安装了我的Apache 2.2,以及php 5.2.

我尝试谷歌搜索和搜索stackoverflow为此但我找不到我正在寻找的答案.

有人能说清楚吗?

php windows apache

1
推荐指数
1
解决办法
2433
查看次数

Font Awesome图标是否适用于Google App Engine环境?

在此输入图像描述

在上面的屏幕截图中,我有三个社交媒体图标显示为方框.我查了下面的html代码.

<ul class="nav pull-left">
        <li class="divider-vertical"></li>
        <li><a title="Like us on WA Facebook" href="#"><i class="fa fa-facebook-square fa-lg"></i></a></li>
        <li><a title="Follow us on WA Twitter" href="#"><i class="fa fa-twitter fa-lg"></i></a></li>
        <li><a title="Subscribe to our WA Youtube channel" href="#"><i class="fa fa-youtube fa-lg"></i></a></li>
 </ul>
Run Code Online (Sandbox Code Playgroud)

我确认它的链接样式表确实存在.我在本地机器环境中从未遇到过这个问题,我的本地wordpress版本与在线wordpress版本完全相同,即3.5.1.那么为什么上传到谷歌应用引擎后我得到这个显示问题呢?

之前有人在将Wordpress迁移到Google App Engine时遇到过这个问题吗?

css wordpress google-app-engine

0
推荐指数
1
解决办法
1377
查看次数