Solved

jquery truncates text in button

Posted on 2014-02-14
2
277 Views
Last Modified: 2014-04-07
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
Comment
Question by:Chris_Ryan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39861001
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
 

Author Comment

by:Chris_Ryan
ID: 39863161
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question