Comments (15)
Sorry, was {{ form.as_p }}, not {{ table.as_p }}..
The error remain..
from django-autocomplete-light.
Humn, that's weird, on what documentation page do you see it ?
I thought all code in the documentation was directly taken from the working test project !
So your error is likely to be elsewhere ...
from django-autocomplete-light.
In non_admin app you use
<html>
<body>
<form method="post" action="">
{% csrf_token %}
<table>
{{ form.as_table }}
</table>
<input type="submit" />
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
{% include 'autocomplete_light/static.html' %}
</body>
I made something like this but replacing {{ form.as_table }} with {{ form.as_p }} and that error occurred.. I didn't try on your demo yet.
from django-autocomplete-light.
Yes, doesn't it work for you ?
from django-autocomplete-light.
Yes, but if you replace {{ form.as_table }} with {{ form.as_p }}, that error occurred
from django-autocomplete-light.
Yess !!! thanks ! I can reproduce this issue. I'm on it panic not xD
from django-autocomplete-light.
;)
from django-autocomplete-light.
I can reproduce the problem with this simple html file:
<p>
<span>hello
<div>
</div>
</span>
</p>
Both Firefox and Chromium will intepret HTML as (according to element inspector):
<p>
<span>hello
</span>
</p>
<div>
</div>
I think this is because div is a block element and isn't allowed to be contained in a
... So Chromium/Firefox think that the HTML is broken and attempts to fix it. As a result, Firefox and Chromium messes with our HTML.
I fear like this is going to be complicated to fix .. any suggestion ?
from django-autocomplete-light.
Mmmm... Not really.... Firefox shouldn't think that this is a broken HTML.. Have you a way to do something from input id directly?
from django-autocomplete-light.
Yes but there's not only that ... inputs can also be added dynamically (ie. formsets) and everything currently depends on having a container ... I can try to hack away that requirement but:
- I can't do this right now, in an hour I can get started
- I'm not sure it's really going to work, at best i can replace divs by spans ... and I'm such an aweful web designer I might even need to get help for that ..
(If you're in a hurry, I can recommend that you use django-uni-form or django-crispy-forms to render your forms nicely ... I haven't used .as_p myself for years ...).
I'm sure that we need to support .as_p thought, at least to make our app solid against browser's messing around.
from django-autocomplete-light.
No no don't worry i can use as_table with no problem for now, i have only reported it..
from django-autocomplete-light.
Thanks for your feedback !
I think the best solution is to fix the widget template to only contain inline elements. If you have a little time and you are good at webdesign and you want to help ... feel free to issue a pull request :D
from django-autocomplete-light.
I'll use your app so i'll try tu fix it but i'm not a designer.. :)
from django-autocomplete-light.
If you want but else I'll just fix the HTML and ask a friend to do me a favor :D
Might take a few days to get it released thought.
I'm wondering about the release version number thought, if this will be considerable as a BC break.
from django-autocomplete-light.
Super-seeded by issue #51.
Thanks again for your feedback.
from django-autocomplete-light.
Related Issues (20)
- Missing sourcemap for `nucleus.css` HOT 3
- Enable duplicate selection HOT 3
- Collectstatic error with whitenoise on 3.9.5 (same as #1281) HOT 11
- Django Widget protocol not implemented properly in WidgetMixin HOT 2
- WidgetMixin __init__ breaks when attrs is None HOT 1
- DAL compatibility with other widgets
- Dal 3.10 not working with django 4.2 HOT 1
- Filtering results based on the value of other fields in the form - issue when i reselect the first field then second field does none change to none
- DAL generates multiple selectboxes for declarative field HOT 1
- DAL 3.10.4rc breaks autocomplete views HOT 5
- autocomplete.ModelSelect2 () not working in bootstrap5 modal HOT 1
- Django Autocomplete light Forward fields outside Admin
- Forward id for a models.ForeignKey("self") HOT 2
- Tutorial gives core not found error
- Wrong selection when clicking on bottom area of item
- Non-rc release forthcoming? HOT 3
- Cloning an autocomplete form dynamically HOT 8
- The selected filter does not filter the model in the admin panel
- Automoving to first selected item
- DAL is re-ordering items with the ModelSelect2Multiple widget HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-autocomplete-light.