Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006
    Posts
    371
    Tokens
    0

    Default Help with javascript!

    PHP Code:
    <script language="javascript">
    function show(k){
            document.getElementById(k).style.display="";
    }
    function hide(k){
            document.getElementById(k).style.display="none";
    }
    </script>
    <div id="welcome">
    <form action="#" method="post">
                <table border="0" width="100%" cellpadding="3" style="border-collapse: collapse">
                <tr>
                    <td class="grn_title"><b>Please enter the number of the receiving cellphone:</b></td>
                </tr>
                <tr>
                    <td height="29"><b>Number:</b><br /><input type="text" name="number" size="30"><br /><b>Please do not use dashes otherwise this will not work.</b></td>
                </tr>
                <tr>
                    <td class="grn_title"><b>Please enter the subject you'd like to send:</b></td>
                </tr>
                <tr>
                    <td height="30"><b>Subject:</b><br /><input type="text" name="subject" size="45"><b><br /> This will be included in the message.</b></td>
                </tr>
                <tr>
                    <td class="grn_title"><b>Please enter the message you'd like to send:</b></td>
                </tr>
                <tr>
                    <td height="27"><b>Message:</b><br /><textarea name="message" rows="3" cols="70"></textarea></td>
                </tr>
                <tr>
                    <td class="grn_title"><b>Please enter the amount of text messages you'd like to send:</b></td>
                </tr>
                <tr>
                    <td height="30"><b>Amount of messages:</b>
                    <select size="1" name="amount">
                    <option value="1">1</option>
                    </select></td>
                </tr>
                <tr>
                    <td class="grn_title"><b>Please choose the receivers service provider:</b></td>
                </tr>
                <tr>
                    <td align="center">
                    <?php
                    get_providers
    ();
                    
    ?></td>
                </tr>
                <tr>
                    <td align="center"><input type="submit" value="Send Message(s)!" name="submit"></div><a href="#k" onClick="hide('welcome');">Hide?</a>
    The javascript at the top and the little onclick at the bottom, if you try this code out, clicking hide will hide the script I have in between the DIV. I need this div, to hide when the page is loaded, and have a SHOW link which will then show it, and I'd also then like to be able to hide it again.

    Could anyone help?

  2. #2
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Add this to your DIV tag:

    style="display: none;"

  3. #3
    Join Date
    Apr 2006
    Posts
    371
    Tokens
    0

    Default

    Now I need to get the show code too work

  4. #4
    Join Date
    Apr 2006
    Posts
    371
    Tokens
    0

    Default

    Done it, thanks everyone

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •