Get height of widget

I’ve got a form with a text area. It could be populated with 1 line, or it could be populated with 10 lines. On submission, the contents get stored in a variable.

This gets displayed in a paragraph widget on the next page for the user to confirm that everything they entered is correct.

Below the paragraph widget is the confirmation button and some other content.

I don’t want to leave a big gap and would like to push the button and content down to accommodate the height of the paragraph whether it’s 1 line or 10.

I can’t work out how to get the final height of the widget if it’s got lots of text to move the lower content down and there doesn’t seem to be a way to push the content on page load or anything.

Is there a way of doing this that I’m missing?

Hi ajacobsuk,

Here what I use for controlling hight:

Set Size:

In repeater

Hi Natalie

Thanks for that. I’m not sure I understand though. I’m not using a repeater. The user might enter.


Hello World


They might enter:


Pellentesque auctor neque nec urna. Ut a nisl id ante tempus hendrerit. Praesent vestibulum dapibus nibh. Vivamus quis mi. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus.

Phasellus tempus. Donec orci lectus, aliquam ut, faucibus non, euismod id, nulla. Phasellus dolor. Etiam sollicitudin, ipsum eu pulvinar rutrum, tellus ipsum laoreet sapien, quis venenatis ante odio sit amet eros. Quisque rutrum.

In hac habitasse platea dictumst. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Curabitur blandit mollis lacus. Pellentesque auctor neque nec urna. Maecenas vestibulum mollis diam.

Praesent venenatis metus at tortor pulvinar varius. Nulla porta dolor. Suspendisse non nisl sit amet velit hendrerit rutrum. Fusce egestas elit eget lorem. Quisque rutrum.

Donec venenatis vulputate lorem. Cras varius. Donec venenatis vulputate lorem. Praesent egestas neque eu enim. Suspendisse enim turpis, dictum sed, iaculis a, condimentum nec, nisi.


I want to make sure that the button always appears directly below what they enter when it’s echoed back to them to confirm so I need to know the height in pixels between the top and bottom.

Cheers
Andy

Please check this posts:

Hey, Andy.

I really wish it was easy to do what you’re asking, but, unfortunately, it is not.

A shape’s size (its “div”, if you will) is independent from its text (which is a “span”). Axure doesn’t refresh the page when it updates the text on a widget so the “div” doesn’t know that its text has changed.

You can use javascript injection to traverse the DOM and try to get the “real” height but nothing directly supported by Axure.

You got exactly what I’m trying to achieve though so I’m glad it’s not just me that can’t find a way. I even tried counting characters, working out how many were in a line and using the line height to do a calculation. Trouble with that is you can get more ‘i’ in a line than you can ‘x’ so it’s just not close enough.

I think you’re right though, Javascript is probably going to be the only way.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.