"Support": sure! I won't "do the work" for you though :)

Okay, Just reading through the django code, and I'm seeing that the 
help_text is _not_ emitted in the field's widget, but in the _html_output 
method of BaseForm In other words, you don't need to update the widget. 
Useless doing so.

So, to ask about the options above, do you want to override the behaviour 
of the admin, or your own code?

Do you use this often enough that you'll want to change the behaviour of 
as_p, as_table or as_ul, or are you happy to just take control of things on 
that side, yourself?

The standard behaviour is to put the help text into <span 
class="helptext">xxx</span> ... its perfectly possible to use jQuery to 
replace all of those instances with whatever HTML you want.


So... which route is going to get you what you need ?


On Friday, December 14, 2012 12:52:23 PM UTC-8, 4 The good Life we work 
wrote:
>
> Hallo Chris, 
>
> thank you for the good explanation. 
> I'm then afread that I have to create my own widget for this. Can you 
> support me on this? 
>
> Thanks, 
> Tony Michael 
>
> On Fri 14 Dec 2012 08:45:40 PM CET, Chris Cogdon wrote: 
> > If you're designing your own HTML (eg: this is not in the admin) then 
> > there's nothing stopping you rendering the help text any way you want. 
> Eg: 
> > 
> > 
> > {{ form.field1 }}<img src="questionmark.gif" 
> > onclick="showpopuphelp('{{ form.field1.help_text }}');return false;" /> 
> > 
> > (that might not exactly work as written, but using it to give you the 
> > gist of things... my preference would be to put the text into a <span 
> > class="fieldhelp> and use jQuery magic to wrap it up) 
> > 
> > If you were doing this a lot, and would prefer to stick with using {{ 
> > form.as_table }} (for example) and rely on the default HTML generators 
> > for each field, then you'll need to create your own widgets, probably 
> > inheriting from the standard widgets, and override the html generators. 
> > 
> > 
> > If you wanted to change how the fields were being displayed in the 
> > ADMIN, then that will require overriding the field widgets in the 
> > ModelAdmin's with your own widgets created the same way above. 
> > 
> > 
> > 
> > On Friday, December 14, 2012 5:16:49 AM UTC-8, 4 The good Life we work 
> > wrote: 
> > 
> >     Hallo, 
> >     I'm wondering if there is a better way to have helptext informs than 
> >     help_text which is displayed under the form. 
> >     Something like FIEDL ? while ? is a button I can click on and it 
> >     displays the helptext. 
> > 
> >     I'll welcome an example. 
> > 
> >     Thanks, 
> >     Tony 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/BroltAZ6DRMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to