fieldset

Why do we need a fieldset tag?

谁说我不能喝 提交于 2019-12-31 07:54:08
问题 Why do we need a <fieldset> tag? Whatever purpose it serves is probably a subset of the form tag. I looked up some info on W3Schools, which says: The <fieldset> tag is used to group related elements in a form. The <fieldset> tag draws a box around the related elements. More explanation for those who are mistaking "why it exists in specification" for "what it does". I think the drawing part is irrelevant, and I don't see why we need a special tag just to group some related elements in a form.

Merging form and fieldset doesn't work?

大兔子大兔子 提交于 2019-12-31 03:52:04
问题 I've a <form> to upload an image and a <fieldset> to send some data using AJAX, they both work fine, but my problem happens when I try to merge them in one form. I'm using Node.JS server. Upload <form> : <form method="post" enctype="multipart/form-data" action="upload"> <input type="file" name="upl"/> <input type="submit" value="Send"/> </form> Node.JS router upload post: router.post('/upload', upload, function (req, res, next) { console.log(req.file); res.status(204).end(); }); <fieldset> :

django admin: How to customize one field in fieldsets?

给你一囗甜甜゛ 提交于 2019-12-30 06:36:24
问题 I try to make one field in django admin's fieldsets to show only certain data, but according to django document, only an example of list_display is shown to be able to customize. I tried the similar approach on fieldsets like the following: In models.py: def ports_with_same_scanner(self): return PortList.objects.filter(scanner=self.scanner) ports_with_same_scanner.short_description = 'port_lists' In admin.py, this won't work: fieldsets = ( ('Scan Template', { 'fields': ( ('name', 'scanner',

django admin: How to customize one field in fieldsets?

假装没事ソ 提交于 2019-12-30 06:35:25
问题 I try to make one field in django admin's fieldsets to show only certain data, but according to django document, only an example of list_display is shown to be able to customize. I tried the similar approach on fieldsets like the following: In models.py: def ports_with_same_scanner(self): return PortList.objects.filter(scanner=self.scanner) ports_with_same_scanner.short_description = 'port_lists' In admin.py, this won't work: fieldsets = ( ('Scan Template', { 'fields': ( ('name', 'scanner',

Incrementing fieldset IDs sometimes results in duplicates

亡梦爱人 提交于 2019-12-25 18:18:02
问题 I am trying to allow the number of input fields to be increased or decreased for several different sections. As demonstrated by the code below, with only 2 sections, each fieldset created should have a unique ID to allow it to be deleted. I have observed that the IDs are not always unique but it is not consistent. Sometimes I can add 10 fieldsets between the 2 groups and not get any duplicate IDs and other times I will start getting duplicates on the 2nd or 3rd fieldset addition. As shown in

How to trigger fieldset factory in ZF3

♀尐吖头ヾ 提交于 2019-12-24 15:26:29
问题 I need to use factory for fieldset. I know how to do it for form, but how to do it for fieldset? The form code is: namespace Application\Form; use Application\Fieldset\Outline; use Zend\Form\Element; use Zend\Form\Form; class Message extends Form { public function __construct() { parent::__construct('message'); $this->setAttribute('method', 'post'); $this->add([ 'type' => Outline::class, 'options' => [ 'use_as_base_fieldset' => true, ], ]); $this->add([ 'name' => 'submit', 'attributes' => [

Do input names have to be unique in the same form?

。_饼干妹妹 提交于 2019-12-24 01:54:42
问题 I have a form with multiple fieldset s. Each fieldset has multiple inputs , some of which would logically share a name attribute. I have looked on MDN for input name and the HTML 5 spec with no luck. Section 4.10.19.1 of the HTML 5 form spec does not mention a uniqueness requirement though. For example: <fieldset name="attendee"> <input name="full-name"> </fieldset> <fieldset name="next-of-kin"> <input name="full-name"> </fieldset> Each input name is unique within the fieldset , but

Make a legend fill up the full width within the fieldset

和自甴很熟 提交于 2019-12-23 09:48:45
问题 I would like to have a background for a legend field within a fieldset . And I want it to take up the full width, but only within the fieldset. If I use legend {width: 100%} it will be wider than the fieldset . Here is an example, runnable in JSFiddle: <html> <head> <style> fieldset { border:0; outline: 1px solid gray; } legend { font-weight:bold; background: orange; width: 100% } </style> </head> <body> <fieldset> <legend>Legend</legend> Content of Fieldset </fieldset> </body> </html> Is

Why won't my <legend> element display inline?

你。 提交于 2019-12-20 16:24:46
问题 I am trying to apply display: inline; to the <legend> element in my <fieldset> element, so that the following <span> will follow on the same line, but my CSS is having no effect. legend{ display: inline; } span { display: inline; } <fieldset> <legend>Legend</legend> <span>Follower</span> </fieldset> JSFiddle EDIT I have no control over the HTML; I can only edit CSS 回答1: Legends are special. In particular, their default rendering can't be described in CSS, so browsers use non-CSS means of

Why fieldset inside flex act differently between browsers

微笑、不失礼 提交于 2019-12-20 03:02:44
问题 I wrote this sample code: <div style="display:flex;flex-direction:row;width:100%"> <fieldset style="white-space: nowrap; width:100%; overflow:auto"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis est id posuere pellentesque. Donec sem lacus, consequat id consectetur a, semper in felis. Suspendisse potenti. Nam eu dapibus ex, nec convallis diam. Donec mollis sit amet nunc quis malesuada. Vestibulum semper cursus magna at commodo. Etiam tincidunt enim vel urna tempor