Solved

Java Script - how to center a text in a form

Posted on 2003-12-05
5
305 Views
Last Modified: 2010-04-17
My URL is http://www.goldensourceusa.com

I have a clock on the top.  The time is on the left side.  I want to center it,  or make the form smaller, or not to have the form.

If you need my script, or form, I will post them here.

Thank you
0
Comment
Question by:wzhu58
  • 3
  • 2
5 Comments
 
LVL 10

Expert Comment

by:D_M_D
ID: 9884034
Just make the boder of the input 0 so you wont see it.

<input type="text" name="clock" style="border:0">

This way all you see is the clock.

Hope this helps...

--------
D_M_D
0
 

Author Comment

by:wzhu58
ID: 9884122
Thank you D_M_D.

Would you please also tell me how to center the text and change the size of the form?

Wendy
0
 
LVL 10

Expert Comment

by:D_M_D
ID: 9884218
Please post the code for your top frame - upper_frame.htm

Thanks
0
 
LVL 10

Accepted Solution

by:
D_M_D earned 125 total points
ID: 9884354
Here you go.  Is this what your looking for...

Just replace the body code in your upper_frame.htm file with this...

<BODY leftMargin=0 topMargin=0 onload=writeTime() MARGINHEIGHT="0"
MARGINWIDTH="0"><center>
<form name="the_form">
<TABLE width="60%" border="0" bgColor=#ffffff height="19">
  <TBODY>
  <TR>
    <TD vAlign=top align=middle width="35%">
      <p style="word-spacing: 0; margin-top: 0; margin-bottom: 0">
      <A href="http://www.goldensourceusa.com/index.html" target=_top><B><FONT
      face=Arial color=#544c4c size=4>www.goldensourceusa.com</FONT></B></A></p>
    </TD>
    <TD vAlign=top align=middle width="40%"><FONT face=Arial
      color=#000000 size=2>
      <SCRIPT language=JAVASCRIPT type=TEXT/JAVASCRIPT>
            document.write( dayName[now.getDay()] + " ,  " + monName[now.getMonth()] +"  " + now.getDate() + "  " + now.getFullYear())
        </SCRIPT>
        <p style="word-spacing: 0; margin-top: 0; margin-bottom: 0"><INPUT
name=the_text size="8" style="border:0"></FONT></TD></TR></TBODY></TABLE></form></center></BODY>

I added a size to the form so the time would look nicer.

--------
D_M_D
0
 

Author Comment

by:wzhu58
ID: 9891851
Hello D_M_D,

It works very well. Thank you.

How you know my html is name upper_frame?  I didn't give you my file name.

wzhu58

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now