fieldset

web.py开发web 第七章 Formalchemy + Jinja2

有些话、适合烂在心里 提交于 2019-11-30 08:47:48
formalchemy是一个强大的表单表格生成框架,几乎所有的动态web开发里都需要处理form表单,而form表单要处理的几个方面包括:表单展现,表单服务端验证,表单前端验证(既js验证),表单数据插入数据库。formalchemy在这几方面都做的非常好,特别是对掌控欲特别强又很懒的人来说:)。由于formalchemy是跟sqlalchemy是配套的(两者名字是如此相似),所以我们可以很好的与前面所创建的User表关联起来。 这一章我们要解决的是关于form的展现,formalchemy自身支持三种 template engine ,分别是: moko , genshi , tempita ,除了mako我没用过,另外两个我都用过了,老实说,不怎么样,但是formalchemy为我们这种有需求的人提供了解决方案, customize templates ,这里我要介绍的就是用jinja2定制一个让我们随便玩的template engine,上代码。 customEngine.py #-*- coding:utf-8 -*- from formalchemy import templates from jinja2 import Environment,FileSystemLoader #定义一个方法用来获取formalchemy输出input的name属性 def field

Is it possible to change a fieldset's background-color on input:focus?

人盡茶涼 提交于 2019-11-29 14:30:59
Is it possible to have the background-color of a form's fieldset change when the cursor is inside any of that fieldset's text fields? I assumed this might work, but it doesn't: fieldset {background: #ffe;} input[type=text]:focus+fieldset {background: #ff0;} I’m afraid it’s not possible with CSS, since CSS hasn’t got a selector that would select on the basis of an element’s children. The selector input[type=text]:focus+fieldset in your attempt matches a fieldset element that immediately follows a focused text input box—something quite different from what you want. It is however possible and

Arranging fieldset elements like a typical table-design

柔情痞子 提交于 2019-11-29 12:08:46
I'm trying to arrange the titles for 3 fieldset elements the same way a typical table looks, but I can't get it the way I want. This comes pretty close, however... <label style="vertical-align:top;">Title1</label> <fieldset style="display:inline; border:none; padding:0px; margin:0px; vertical-align:middle;"> <input value="Lorem Ipsum" /><br /> <input value="Lorem Ipsum" /><br /> <input value="Lorem Ipsum" /> </fieldset> <label style="vertical-align:top;">Title2</label> <fieldset style="display:inline; border:none; padding:0px; margin:0px; vertical-align:middle;"> <input value="Lorem Ipsum" />

Rounded corners on a fieldset

情到浓时终转凉″ 提交于 2019-11-29 02:58:42
I noticed that the "fieldset" tag renders a rounded corner border on IE (it renders squared on the other browsers). <fieldset> <legend>My legend</legend> </fieldset> BUT if i set a CSS style on the fieldset, the rounded corners disappear!! Anybody know why? How to keep the rounded corners but with another border color? [EDIT] : sorry for the confusion, i don't ask how to have rounder corners on firefox/other browsers, i want to know how to keep the rounder corners on IE and have another border color (border-color:red; on the fieldset changes the rounds to squares...). Some items (buttons,

Is it wrong to use the fieldset tag without form tag?

荒凉一梦 提交于 2019-11-29 02:49:16
I was wondering if I can use the fieldset tag without being inside a form . Because I like the way it encloses the legend & the border stuff around the inner html. When I use it to enclose li element, it does behave like its actually there(visual) inside a form. It's valid HTML5. Paste the following HTML at the validator: http://validator.w3.org/check : <!DOCTYPE html> <html> <head><title>Title</title></head> <body> <fieldset> <legend>Test</legend> </fieldset> </body> </html> It's also valid HTML4. Replace <!DOCTYPE html> with the following, and it still passes the validation: <!DOCTYPE html

Which CSS tag creates a box like this with title?

别说谁变了你拦得住时间么 提交于 2019-11-29 01:28:08
问题 I want to create a box like this with title: Can any one please let me know if there is a default CSS tag to do this? Or do I need to create my custom style? 回答1: I believe you are looking for the fieldset HTML tag, which you can then style with CSS. E.g., <fieldset style="border: 1px black solid"> <legend style="border: 1px black solid;margin-left: 1em; padding: 0.2em 0.8em ">title</legend> Text within the box <br /> Etc </fieldset> 回答2: If you are not using it in forms, and instead want to

fieldset width 100% of parent [duplicate]

人走茶凉 提交于 2019-11-28 13:42:50
This question already has an answer here: <fieldset> resizes wrong; appears to have unremovable `min-width: min-content` 4 answers I need to have a scrollable div inside a fieldset. My problem is that a fieldset expands to it's contents width instead of staying withing its parent. <div class="section"> <fieldset> <div class="list"> </div> </fieldset> </div> http://jsfiddle.net/UziTech/tg5uk25L/ The two boxes should both have scrollbars on the bottom but the top one is in a fieldset so it won't control the overflow. How do I get the fieldset to only be as wide as it's parent? Browsers have

Printing fieldsets in firefox

懵懂的女人 提交于 2019-11-28 09:13:42
I've been adding some new css to an existing project (using media="print") in the page header. It's going smooth and (for once!) IE is giving nice, expected results, but Firefox does not... The problem is that I have a fieldset which contains a lot of fields, and Firefox completely refuses (even in the latest version) to allow a page break inside the fieldset. This means anything that doesn't fit on one page is lost... I've found the bug acknowledged on the mozilla website which has been open for 3 years - https://bugzilla.mozilla.org/show_bug.cgi?id=471015 - but can't find any reasonable

Why are not all flexbox elements behaving like flexbox divs?

和自甴很熟 提交于 2019-11-28 09:01:37
Why is flexbox not working properly with fieldset or other non- div tags? I expect them to line up next to each other like in the div example, as flex-direction: row; is default in flexbox. However fieldset is force applying a width to them, and I do not understand why. HTML <fieldset> <div>fieldset flexbox</div> <div>1</div> <div>2</div> </fieldset> <div id="parentdiv"> <div>div flexbox<div> <div>3</div> <div>4</div> </div> CSS: All elements are set to display: flex ; http://jsfiddle.net/c5BB5/1/ As far as I can tell, this is down to browser bugs to do with the fieldset element. It's a known

Is it possible to change a fieldset's background-color on input:focus?

跟風遠走 提交于 2019-11-28 08:00:29
问题 Is it possible to have the background-color of a form's fieldset change when the cursor is inside any of that fieldset's text fields? I assumed this might work, but it doesn't: fieldset {background: #ffe;} input[type=text]:focus+fieldset {background: #ff0;} 回答1: I’m afraid it’s not possible with CSS, since CSS doesn't have a selector that would select on the basis of an element’s children. The selector input[type=text]:focus+fieldset in your attempt matches a fieldset element that immediately