Question:

Website coding (HTML)?

by  |  earlier

0 LIKES UnLike

Okay, i think the code i need is HTML based.

I want to have a few pieces of text and each one will bring up a certain form.

The forms will be pre-made.

 Tags:

   Report

2 ANSWERS


  1. I'm sorry, but I'm not entirely sure what you mean.

    If you want HyperLinks (Text that, when clicked, send you to another web page) in a web page, you can make them with the following code:

    <a href="http://URL.TO.YOUR.SITE">

    HyperLink text

    </a>

    Be sure to change http://URL.TO.YOUR.SITE to the URL of the form.

    If this isn't what you were looking for, please give us more information.


  2. What you want to do can be easily done by using hidden forms and changing each of the form's display properties from "none" to "block"using javascript. The forms could be positioned absolutely inside of another div and stacked right on each other, then just display whichever one is desired by clicking a link with an onclick event to call the javascript function. The onclicks could be placed in another element as well, such as img or others. In this script example all the x variables are given the exact same value (off) outside of the function. Then in the onclick events arguments, we can pluck out the exact one we want to change it's value for inside the function, and after the script is executed all the x variables are returned to their outside values once again. That way the previously shown form will be re-hidden if a different onclick is clicked on. Try this example out, and feel free to contact me if you need something a bit different:

    <!DOCTYPE -don't forget to use one of these

    <html>

    <head>

    <title></title>

    <style type="text/css">

    #formholder { position:relative; height:50px; }

    #formOne { position:absolute; left:0; top:0; display:none; background:yellow; }

    #formTwo { position:absolute; left:0; top:0; display:none; background:green; }

    #formThree { position:absolute; left:0; top:0; display:none; background:red; }

    </style>

    <script type="text/javascript">

    var on = "block";

    var off = "none";

    var x1=x2=x3=off;

    function showForm()

    {

    document.getElementById ("formOne").style.display = x1;

    document.getElementById ("formTwo").style.display = x2;

    document.getElementById ("formThree").style.display = x3;

    x1=x2=x3=off;

    }

    </script>

    </head>

       <!--End Head-->

    <body>

    <div id="formholder">

    <form id="formOne" action="get">

    <p>This is form one

    <input type="text" value="" />

    <input type="text" value="" />

    </p>

    </form>

    <form id="formTwo" action="get">

    <p>This is form two

    <input type="text" value="" />

    <input type="text" value="" />

    </p>

    </form>

    <form id="formThree" action="get">

    <p>This is form three

    <input type="text" value="" />

    <input type="text" value="" />

    </p>

    </form>

    </div><!-- end formholder div -->

    <ul>

    <li><a href="#" onclick="showForm(x1=on); return false;">Form one</a> </li>

    <li><a href="#" onclick="showForm(x2=on); return false;">Form two</a> </li>

    <li><a href="#" onclick="showForm(x3=on); return false;">Form three</a> </li>

    </ul>

    </body>

    </html>
You're reading: Website coding (HTML)?

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.