Pregunta

On a drupal site I have a webform with table-like sorted inputs. Its hard to display long descriptions nicely. Any suggestions?

¿Fue útil?

Solución

This is what I made to attach descriptions collapsed to labels (added as node description):

<script type="text/javascript">
    $(document).ready(function(){   
        $(".form-item:has(div.description)").children("label").append(function(){
            $(this).parent().children('.description').hide();
            return '<sup><a href="#" onclick="$(this).parent().parent().parent().find(\'.description\').toggle();" title="'+$(this).parent().children('.description').text()+'"><strong>?</strong></a></sup>';
        }); 
    });
</script>

Sandbox here: http://jsfiddle.net/eapo/3ubec/

Any other suggestions?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top