Showing / Hiding Tables or Pictures in VBSCRIPT

Posted on 2004-11-02
Last Modified: 2010-04-06
I need some help creating an if Statement in VBScript.

I am using frontpage 2000 with vbScript code.

On the top of my page, i have some text boxes where the user enters values and press the button calculate.
I would like to show the bottom part of the screen where the result of the calculations are only showed when the user clicks the "Calculate" button. Before that, the user only sees the top of the page.

I have tried different approaches but the i have decided that two of them would be the more effective ones.
 1- I can cover the bottom half of the calculator with a picture and then when the button is clicked the picture disappears.
 2 - the sencod option would be creating an if statement where my html code will be added after the validation of the if stament. when i try that i get an error message. it seems like html code cannot go inside VBSCRIPT.

 so my questions would be. Do you know how to hide/show pictures in vbscript? Can html code be used inside vbscript section? if it is possible, how should i go about it?

if this helps:
the name of the picture is texas, the name of the form is Calculator
and the tables that i want to hide have several text boxes inside

Thanks in Advance,

Question by:virgilar
    LVL 35

    Accepted Solution

    put your picture inside the <div> and then set visibility to false to make it invisible, and set it to true to mAKE YOUR IMAGE VISIBLE AGAIN:

    <DIV ID="myDIV">
    <img src="test.jpg">
    LVL 7

    Assisted Solution

    <script language=javascript>

    function calculate() {

    var div_ref = document.all("id_div"); = "hidden";

    var div_ref = document.all("id_div1"); = "visible";
    function recalculate() {

    var div_ref = document.all("id_div"); = "visible";

    var div_ref = document.all("id_div1"); = "hidden";

    <form name=frm_test id=frm_test>

    <div id=id_div1>

    input1:<input type=text value="">
    input2:<input type=text value="">
    input3:<input type=text value="">
    <input type=button Value=calculate onclick=recalculate()>

    <div id=id_div style="top: 320; width:100%; visibility:hidden">
    <input type=text value="">
    <input type=button Value=Recalculate onclick=calculate()>


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Android App Development

    This course will involve creating widgets, customize list view, grid view, spinners, etc. Creating applications using audio, video, and SQLite database. Ending with publication on Google Play.

    Shoutout to Emily Plummer ( for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
    Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    794 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

    16 Experts available now in Live!

    Get 1:1 Help Now