473,769 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Right align content of <INPUT> field

If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?

The fields in my form are for numbers, and they look strange aligned left.

--
Steve Swift
http://www.ringers.org.uk
Sep 27 '06 #1
4 54754
Steve Swift wrote:
If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?

The fields in my form are for numbers, and they look strange aligned left.
input.whatever {
text-align: right;
}

But that will probably confuse users. I wouldn't recommend it.
Sep 27 '06 #2
If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?
Have you already tryed align="right" or style="text-align: right"?

Sep 27 '06 #3
Have you already tried align="right" or style="text-align: right"?

I hadn't tried that, but it produced exactly the effect that I wanted.
Thank you!

And Leif, no need to worry about the "user" - that's me. I agree
entirely that it's a very odd effect when you're not expecting it!
However, I tend to use right-aligned fields in Word documents quite
regularly, so I'm over the worst of the effects!

--
Steve Swift
http://www.ringers.org.uk
Sep 27 '06 #4
On Wed, 27 Sep 2006 04:45:34 -0400, Leif K-Brooks
<eu*****@ecritt ers.bizwrote:
>Steve Swift wrote:
>If it is possible, could someone demonstrate how to make the text
entered into an <INPUT TYPE=TEXTfield right-align within the entry
field, please?

The fields in my form are for numbers, and they look strange aligned left.

input.whatev er {
text-align: right;
}

But that will probably confuse users. I wouldn't recommend it.
A quick check of three different mobile phones reveals that they all
right-align the numbers being typed in, so I suggest that an awful lot
of people will already be familiar with the concept. (Pretty strange
actually - right-aligning *telephone* numbers isn't a sensible thing to
do, as there are no column weights involved. Telephone numbers are
really just a special kind of text string.)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Sep 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
13124
by: Jonathan Daggar | last post by:
Hello, I'm trying to put together a form with a very tight table formatting. However, every time I put an text-type input field in, the browser pads the area to the right of it with space. I've tried to eliminate it several ways, but it won't go away. It looks like it's forcing at least one space (line break?) in after each field, and then there's some mystery padding on the right that also refuses to go away. I've put up a demo of...
5
10457
by: Mikko Rantalainen | last post by:
See example at <URL:http://www.cc.jyu.fi/~mira/moz/formtest.php>. The problem is that the label of submit button is always centered on the button regardsless of 'text-align' property in CSS. Considering that I can style everything else, this must be a bug, right? Any suggestions how to fix the issue with Mozilla 1.4? How about other versions of Mozilla? How about other browsers? (I'm aware that some people think that one should never...
3
13156
by: TR | last post by:
Is it possible with CSS to prevent this wrapping alignment with a checkbox with a nested label? This is the label of the checkbox that wraps beneath it I'd prefer it looked like this, with a flush left margin:
3
12936
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input type=submit value='Done'> </form>
5
2259
by: Bart van Deenen | last post by:
Hi all I have a form with a couple of input fields, embedded within spans. I am using script.aculo.us for dragging and dropping, and want to reorder the input fields that way. The input fields are display:inline because I want them all on the same line. Does anyone know of a smart trick to be able to drag these input fields? Just setting their disabled attribute doesn't work, because then they get no events. Not setting disabled just...
2
3386
by: Richard Maher | last post by:
Hi, I'm trying to use the Visibility Style attribute for a Div to effectively PopUp a lightweight window with some additional context-sensitive information, when a user mouses over a given field(s). The popping-up seems to work just fine; it's the tearing down that's giving me grief. If I stick a onmouseout event on the same input field that caused the onmouseover/pop-up, it starts to flicker 'cos the <divis placed for esthetically...
1
2537
by: JPhilS | last post by:
Hi to all Webmaster! I have discover this problem when I inserted the scores of the students i a centain subject. I am making a school project with regards to saving students' record. first, I have to view all students under the certain subject and at the last field, I putted a form to put the scores of each student. say '<input type=text name='score' size=10>' and number of '<input type=text>' is equal to the number of students. I...
1
5508
by: test9991014 | last post by:
Hi folks, I've got something like this: <table> <tr> <td>1</td> <td align=center> <input type=text> </td>
8
3626
by: Zhang Weiwu | last post by:
hello. Is it possible to design CSS in the way that content in <inputare not visible in print out (a.k.a. value of <inputnot visible) while the border remain visible? trial: input { border: thin solid black;
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.