PDA

View Full Version : Help with javascript!



retrocore
30-04-2006, 08:03 AM
<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&#39;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&#39;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&#39;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?

Tomm
30-04-2006, 08:06 AM
Add this to your DIV tag:

style="display: none;"

retrocore
30-04-2006, 08:08 AM
Now I need to get the show code too work

retrocore
30-04-2006, 08:09 AM
Done it, thanks everyone :)

Want to hide these adverts? Register an account for free!