?
Solved

jquery truncates text in button

Posted on 2014-02-14
2
Medium Priority
?
282 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 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

718 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