首页 \ 问答 \ Jquery dform插件单选按钮对齐(Jquery dform plugin radio button alignment)

Jquery dform插件单选按钮对齐(Jquery dform plugin radio button alignment)

我是Javascript的新手,并致力于创建一个包括radiobuttons的简单表单。 这是我创造的小提琴:

http://jsfiddle.net/nax97af6/

我的HTML

<form id="myform"></form>

使用Javascript

$("#myform").dform({
    "action" : "index.html",
    "method" : "get",
    "html" :
    [
        {
            "type" : "p",
            "html" : "Edit Rule"
        },
        {
            "name" : "ruleid",
        "id" : "ruleid",
        "caption" : "Rule ID",
        "type" : "text",
        "placeholder" : "NRF_Rule_123"
    },
    {
        "name" : "rulepriority",
        "id" : "rulepriority",
        "caption" : "Rule Priority",
        "type" : "number",
        "placeholder" : "3"
    },
    {
        "name" : "rulebody",
        "id" : "rulebody",
        "caption" : "Rule Definition",
        "type" : "div",
        "html" :
        [
            {
                "type" : "text"
            }
        ],
        "placeholder" : "Define your rule body here"
    },
   {
        "name" : "ruleenabled",
        "type":"radiobuttons",
       "id": "radiobuttonalign",
        "caption" : "Make rule available for use",
        "options" : {
            "No" : "No",
            "Yes" : {
                "checked" : "checked",
                "caption" : "Yes"
            }
        }
    },
    {
        "type" : "submit",
        "value" : "Save rule"
    }
]
})    

我的CSS:body {font-family:sans-serif; 填充:10px; }

label, input {
    display: block;
    margin-top: 10px;
}

我试图对齐单选按钮选项,即水平是或否。 其余的应该是垂直的。 到目前为止,我已尝试使用dform插件页面上建议的css选项和类选项

https://github.com/daffl/jquery.dform

但没有运气。

如果我删除显示:块; 组件所有字段都水平对齐。 我想只水平对齐radiobutton选项。

任何指导,以帮助我学习和纠正这个问题非常感谢。

谢谢


I am fairly new to Javascript and working on creating a simple form including radiobuttons. This is the fiddle which I created:

http://jsfiddle.net/nax97af6/

My HTML

<form id="myform"></form>

Javascript

$("#myform").dform({
    "action" : "index.html",
    "method" : "get",
    "html" :
    [
        {
            "type" : "p",
            "html" : "Edit Rule"
        },
        {
            "name" : "ruleid",
        "id" : "ruleid",
        "caption" : "Rule ID",
        "type" : "text",
        "placeholder" : "NRF_Rule_123"
    },
    {
        "name" : "rulepriority",
        "id" : "rulepriority",
        "caption" : "Rule Priority",
        "type" : "number",
        "placeholder" : "3"
    },
    {
        "name" : "rulebody",
        "id" : "rulebody",
        "caption" : "Rule Definition",
        "type" : "div",
        "html" :
        [
            {
                "type" : "text"
            }
        ],
        "placeholder" : "Define your rule body here"
    },
   {
        "name" : "ruleenabled",
        "type":"radiobuttons",
       "id": "radiobuttonalign",
        "caption" : "Make rule available for use",
        "options" : {
            "No" : "No",
            "Yes" : {
                "checked" : "checked",
                "caption" : "Yes"
            }
        }
    },
    {
        "type" : "submit",
        "value" : "Save rule"
    }
]
})    

My CSS: body { font-family: sans-serif; padding: 10px; }

label, input {
    display: block;
    margin-top: 10px;
}

I am trying to align the radio button options i.e. Yes or No horizontally. The rest of them should be vertical. So far, I have tried using css option and class option as suggested on the dform plugin page

https://github.com/daffl/jquery.dform

but no luck.

If I remove the display: block; component all the fields get aligned horizontally. I want to only align the radiobutton options horizontally.

Any pointers to help me learn and rectify the issue is greatly appreciated.

Thank you


原文:https://stackoverflow.com/questions/39519304
更新时间:2024-03-19 12:03

最满意答案

我已经在Windows 7 Professional 32位计算机上成功安装了IPython 0.13.1。 所以,让我与您分享我是如何做到的。

  1. 安装Python 3.3

    • 安装到默认文件夹:C:\ Python33
  2. 安装分发

    • 下载分发: http//pypi.python.org/pypi/distribute
    • 提取到:C:\ distribute
    • 在命令提示符处:导航到C:\ distribute
    • 在命令行上运行: C:\Python33\python distribute_setup.py
  3. 安装pyreadline

    • 下载pyreadline: https//github.com/pyreadline/pyreadline
    • 点击“ZIP”下载PyReadline存储库的zip文件
    • 提取到C:\ pyreadline
    • 在命令提示符处:导航到C:\ pyreadline
    • 运行: C:\Python33\python setup.py install
  4. 安装pygments和pyzmq

    • 在命令提示符处:导航到C:\ Python33 \ Scripts
    • 运行: easy_install pygments pyzmq
  5. 下载并安装下3个:

    • ZeroMq: http ://www.zeromq.org
    • PySide: http ://www.pyside.org
    • IPython: http ://www.ipython.org
  6. 启动IPython

    • 应该有一个“开始菜单”快捷方式
    • 开始菜单>所有程序> IPython> IPythonQT

I have successfully installed IPython 0.13.1 on a Windows 7 Professional 32-bit computer. So let me share with you how I did it.

  1. Install Python 3.3

    • Install to default folder: C:\Python33
  2. Install distribute

    • Download distribute: http://pypi.python.org/pypi/distribute
    • Extract to: C:\distribute
    • At the command prompt: navigate to C:\distribute
    • Run on command line: C:\Python33\python distribute_setup.py
  3. Install pyreadline

    • Download pyreadline: https://github.com/pyreadline/pyreadline
    • Click on "ZIP" to download a zip file of PyReadline repository
    • Extract to C:\pyreadline
    • At the command prompt: navigate to C:\pyreadline
    • Run this: C:\Python33\python setup.py install
  4. Install pygments and pyzmq

    • At the command prompt: navigate to C:\Python33\Scripts
    • Run this: easy_install pygments pyzmq
  5. Download and install the next 3:

  6. Launch IPython

    • There should be a Start Menu shortcut
    • Start Menu > All Programs > IPython > IPythonQT

相关问答

更多
  • 它被称为World Wide Web Publishing Service ,在列表底部附近。 It's called World Wide Web Publishing Service, right down near the bottom of the list.
  • 好的,我想通了。 pyreadlineconfig.ini文件位于错误的目录中。 我在Ambiguous选项卡中完成了不能在Windows上的iPython中工作的修复程序 表示要将此文件复制到%HOMEPATH%。 原来这个环境变量在我的电脑上配置错误,文件被复制到e:\ pyreadlineconfig.ini。 正确的路径,但应该是c:\ users \ username。 Ok I figured out. The file pyreadlineconfig.ini was located in t ...
  • 不确定这是否是正确的答案,但我能够通过这样做 - from readline import rl as readline readline.mode.show_all_if_ambiguous("on") 基本上readline.py有一个Readline类实例rl,它具有我正在修改的'mode'属性。 基本上配置文件也是如此。 但是这个解决方案在脚本本身中具有方便性。 Not sure if it's the correct answer, but i was able to get it workin ...
  • 是的,pyreadline在Windows上被破坏,IPython将在下一个版本(5.0)上远离readline。 这应该解决问题。 Yes, pyreadline is broken on windows, IPython will move away from readline on the next version (5.0). This should fix things.
  • 我意识到这已经有两年了,但我刚刚能够解决类似的问题,所以看到更多的答案会更好。 在我的情况下,它不是Windows防火墙或病毒扫描程序,而是我的雇主的IT服务组通过硬编码到0MQ的同一端口运行VNC,正如iPython在Anaconda中使用的那样。 足够的人抱怨IT提供了一个脚本来移动受影响人群的VNC端口,同时也记录了他们自己记录中的变化,所以每个人都很高兴。 尝试从命令行执行“netstat -ab”,并检查是否有任何内容正在侦听iPython所需的端口5905(至少与2016年初的Anaconda相 ...
  • 我能够通过碰到巧克力的预发布版本来实现这一目标。 9.10.x-β... 我应该注意,只是做一个-pre还不足以让它安装软件包...出于某种原因我不得不 - 强制使用软件包以获得巧克力来更新自己。 不确定这是否是设计的。 I was able to get this working by bumping to the prerelease version of chocolatey. 9.10.x-beta... I should note that just doing a -pre was not en ...
  • 好的,这是我的解决方案,让IPython 0.12.1在同一系统上使用Python ver 2.7.x和3.2.x (即在Windows 7 64位和XP SP2 32位下)。 它不完美,但有效,希望能帮助别人。 我在哪里显示目录,他们指的是XP(但应根据Windows 7进行相应调整) 两者的步骤: 通过Python.org提供的二进制窗口安装程序安装两个版本的Python 安装此版本的pyreadline pyreadline-2.0-dev1.win32.exe ,适用于两个版本的Python(我无法 ...
  • 我已经在Windows 7 Professional 32位计算机上成功安装了IPython 0.13.1。 所以,让我与您分享我是如何做到的。 安装Python 3.3 安装到默认文件夹:C:\ Python33 安装分发 下载分发: http : //pypi.python.org/pypi/distribute 提取到:C:\ distribute 在命令提示符处:导航到C:\ distribute 在命令行上运行: C:\Python33\python distribute_setup.py 安装p ...
  • 如其网站所述, PyReadline库用于Windows 。 查看堆栈跟踪的最后几行: import ctypes.wintypes as wintypes File "/usr/local/lib/python2.7/ctypes/wintypes.py", line 23, in class VARIANT_BOOL(_SimpleCData): ValueError: _type_ 'v' not supported 它试图从ctypes导入特定于Windows的数据类型,这显然是 ...
  • 解决方法是卸载安装ipython时拉出的pyreadline版本( pip uninstall pyreadline )并从http://www.lfd.uci.edu/下载并安装pyreadline-1.7.1.win32-py2.7.exe 。 gohlke / pythonlibs /#pyreadline The solution was to uninstall the version of pyreadline pulled when ipython was installed (pip uni ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)