Field dynamic width
Hello,
I have a embedded display form which shows different informations about people.
Values in text fields have different length.
Sometimes the predefined width of fields is not user friendly and I get results like this:
Name1 Info1 Info2
When input values are with bigger length its more user friendly:
ReallyLongName ReallyLongSurname Info1 Info2
I would like to have a dynamic width which would show me this if the input have smaller length:
Name1 Info1 Info2
-
Hi,
I found a way to do this with a script line inside the form load action:
I have used this and it works, it could be maybe better written but for now its enough
jQuery('span [fieldname=Title]').parent().parent().parent().css('width',((jQuery('span [fieldname=Title] > span').text().length + 1) * 8) + 'px');
0 -
0
Please sign in to leave a comment.
Comments
2 comments