wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes changing Alignment of 'Text' component Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "changing Alignment of Watch "changing Alignment of New topic

changing Alignment of 'Text' component

stago pat

Joined: Jan 21, 2004
Posts: 4
Hi -
I have a Text( InputBox) with Absolute position on the HTML page , now according to user selection I want to reposition this text with the use of Java Script.
Is this possible !! Ir yes.. then please show me the way...
In HTML code below - I want to change Top and left alignment, according to user selection with the use of Java Script.
So that the rendering page, will reposition the 'text'.
Please find below - HTML code for this 'Text'

<input type="text" name="C2A2" title="C2A2" size="1"
style="position:absolute; top:375px; left:170px; {background-color: #ccffcc}"
onchange="checkType(this, 'double')"/>
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
You are wanting to change the text alignment in the text box?/
If so then it is CSS
with JavaScript it probably is
document.FormName.ElementName.style.textalign = "right";
wood burning stoves
subject: changing Alignment of 'Text' component
Similar Threads
To call and load javascript in struts jsp.
Strange problem in Html page
hoe to display text with 'justify' alignment..?
how to call different java script codes on different button click
how to use selectOneRadio with javascript?