Jquery dform插件单选按钮对齐(Jquery dform plugin radio button alignment)
我是Javascript的新手,并致力于创建一个包括radiobuttons的简单表单。 这是我创造的小提琴:
我的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:
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
最满意答案
我已经在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
安装pyreadline
- 下载pyreadline: https : //github.com/pyreadline/pyreadline
- 点击“ZIP”下载PyReadline存储库的zip文件
- 提取到C:\ pyreadline
- 在命令提示符处:导航到C:\ pyreadline
- 运行:
C:\Python33\python setup.py install
安装pygments和pyzmq
- 在命令提示符处:导航到C:\ Python33 \ Scripts
- 运行:
easy_install pygments pyzmq
下载并安装下3个:
启动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.
Install Python 3.3
- Install to default folder: C:\Python33
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
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
Install pygments and pyzmq
- At the command prompt: navigate to C:\Python33\Scripts
- Run this:
easy_install pygments pyzmq
Download and install the next 3:
- ZeroMq: http://www.zeromq.org
- PySide: http://www.pyside.org
- IPython: http://www.ipython.org
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.
-
IPython权限被拒绝(IPython Permission Denied)[2022-05-04]
我意识到这已经有两年了,但我刚刚能够解决类似的问题,所以看到更多的答案会更好。 在我的情况下,它不是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 ...
-
使用两个版本的Python安装IPython(Windows)(installing IPython with two versions of Python (Windows))[2023-06-19]
好的,这是我的解决方案,让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 ...