Can you control placement of forms and text on a page

Discussion in 'JavaScript' started by 8SJ0gcv0IKHKnknM, Jan 31, 2009.

  1. #1
    All the examples I have seen of text and forms place them in order on a web page. Is there a way to place a form and / or java text strings anywhere on the web page. As an example I have an image on the right of a page. Right now all I can do is move the order of the script lines so that the form or text is located above or below the image. My goal is to place the form or text left an about center of the image.

    What do I have to do to move the form and text below anywhere on the page?

    <img src="image.JPG"
    id="animImage" height=
    "600" width="800">

    <form name="animForm">
    <input type="button" id="b1" value="Start" name="animButton"
    onclick="buttonCheck()"><input type="text" value="250"
    name="animPace">milliseconds
    </form>

    <script type="text/javascript">

    var firstname;
    firstname="Some Text Here";
    document.write(firstname);
    </script>
     
    8SJ0gcv0IKHKnknM, Jan 31, 2009 IP
  2. JDOMPer

    JDOMPer Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,
    I may have missed something.
    BUT the best way to control positioning on the page is to use absolute positioning and put each element inside a DIV

    <Head>
    <style TYPE="text/css">

    #myform {
    visibility: visible;
    position: absolute;
    top: 240px;
    left: 10px;
    z-index: 50;
    font: normal normal bold 10pt/11pt arial, helvetica, times;
    color: black;
    }

    </style>
    </head>


    <body>
    <DIV id="myform">
    <form action="javascript:findme()" method="GET" enctype="text/plain">
    etc. etc.
    </form>
    </DIV>
    </body>

    Change top: 240px; and left: 10px; to position anywhere on the page
     
    JDOMPer, Jan 31, 2009 IP
  3. 8SJ0gcv0IKHKnknM

    8SJ0gcv0IKHKnknM Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, I have had VBA and Basic experience and did some HTML but I am brand new at everything else. The idea of mixing css and javascript is a little hard for follow at this point. I guess I need to look at a book that is pre-basic programing when dealing with these languages. Now that I see what has to be done I know where to start looking. I have to admit I don't understand fully what you posted but I get the idea and now know where to look. Basically, what I have to learn about. Thanks again your response was very helpful.
     
    8SJ0gcv0IKHKnknM, Feb 2, 2009 IP