I want to split my text box into three areas eg: I want values to be displayed like 951-05-8765456. Is there a way to display the "-" by default after 3 places and so when the user enters the value it will be split automatically.I want my text box to be as in the image
Right-click the text box, placeholder, or shape border, and click Format Shape. Click Columns, enter the number of columns in the Number box, and the space between each column (in inches) in the Spacing box.
Objects like textboxes can't be split over multiple pages in Word. You might want to consider using a single cell table instead. Table cells can split over multiple pages and you can set the properties so that text is wrapped around them. Was this reply helpful?
Click the AutoFit Options tool at the lower-left corner of the placeholder box. Select Split Text Between Two Slides or Continue on a New Slide. A new slide is created immediately after the current one. Split Text ...
Basically you can't do with only CSS, so you can use this jquery plugin and you do it easily.
Mask Plugin
You can use this plugin for your textbox as follow:
$(".TEXT_BOX_CLASS").mask("9999/99999/99999");
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<style type="text/css">
</style>
</head>
<body>
<input type="text" class="mynum" value="" />
<script type="text/javascript">
$('.mynum').keydown(function () {
var value = $('.mynum').val();
var len = value.length;
if (len == 4)
value += '/';
if (len == 10)
value += '/';
if (len == 16)
return false;
$('.mynum').val(value);
});
</script>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With