Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

jquery truncates text in button

We are developing a survey module for mobiles and tablets using jquery mobile.

On screen, we present the User with a question and a number of options (responses) to select.

If the response is long we want the button to automatically size vertically and wrap the text within the horizontal width of the button.

Currently the text simply truncates so as to make it unreadable.  So as an example:

Correct Text
"I disagree completely with this statement"

Displayed Text
"I disagree comp ..."

The amount of text varies significantly for different responses, so we don't want to create a huge fixed text box just for the odd one or two long responses (it also reduces the space available for the questions)

Any ideas as to a viable solution would be greatly appreciated :)
0
Chris_Ryan
Asked:
Chris_Ryan
1 Solution
 
Scott Fell, EE MVEDeveloperCommented:
Can you provide a sample code.  This seems to work fine.  http://jsbin.com/gekop/1


<!DOCTYPE html>
<html>
<head>
<link href="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <button>Yes</button>
  <button>No</button>
  <button>I disagree completely with this statement</button>

</body>
</html>

Open in new window

0
 
Chris_RyanAuthor Commented:
Hi Scott,

Thanks so much for this

We are closed over the weekend, but we'll check it out on Monday and get back to you with our sample code

Cheers
Chris
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now