Question

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

Était-ce utile?

La solution

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?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top