View Full Version : doubt in javascript programing

07-28-2009, 10:40 AM
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...

<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';


please solve this and give me an answer through the code pls

07-29-2009, 06:22 AM
First - use CODE tags around your code when you post. It just makes it easier to read. As for your question... Try changing:

document.getElementById('txtFullnameFailed').innerHTML.display = 'none';


document.getElementById('txtFullnameFailed').style.display = 'none';