Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    doubt in javascript programing

    hello friends really i am in a trouble where i need to get solve my program can any body help me where i need to hide my span id through onclick command but its not working.....my program is below...

    Code:
    <label for="txtFullname">First Name:</label>
                    <a id="myHeade2" href="javascript:showonlyone('newboxes2');" >
                    <input id="txtFullname" name="txtFullname" type="text" style="font-size:16pt;"
                    onblur="validate(this.value, this.id)"
                    value="<?php echo $_SESSION['values']['txtFullname'] ?>" /></a></td><td width="262"><div name="newboxes" id="newboxes2"style="solid black; background-color: #CCCCCC;padding: 10px; display: none;">hai hello</div>
    				
                    <span id="txtFullnameFailed" class="<?php echo $_SESSION['errors']['txtFullname'] ?>" onclick="dosomething();">
                        Empty field or only charcters.</span>
    
    <script type="text/javascript">
    function dosomething()
    {
      document.getElementById('txtFullnameFailed').innerHTML.display = 'none';
     } 
       
    </script>
    please solve this and give me an answer through the code pls
    Last edited by Trinithis; 07-29-2009 at 07:06 AM. Reason: code tags

  • #2
    Regular Coder
    Join Date
    Jul 2009
    Location
    Chicago, IL
    Posts
    169
    Thanks
    26
    Thanked 3 Times in 3 Posts
    First - use CODE tags around your code when you post. It just makes it easier to read. As for your question... Try changing:
    Code:
    document.getElementById('txtFullnameFailed').innerHTML.display = 'none';
    To:
    Code:
    document.getElementById('txtFullnameFailed').style.display = 'none';


  •  

    Posting Permissions

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