MyBB Community Forums

Full Version: how to add dynamic data in source of web page ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am using simple javascript toogle function with the following code.

<script>
function add_more(){
if (document.form.more[0].checked==true)
{

document.getElementById('moreTxt').style.display="block";

}

else if (document.form.more[1].checked==true)
{

document.getElementById('moreTxt').style.display="none";
}
}
</script>


do want to enter something more ? 
<form name="form">
<input type="radio" value="yes" name="more" onclick="add_more()" /> Yes
<input type="radio" value="No" name="more" onclick="add_more()" /> No
<div id="moreTxt" style="display:none">
hi you can enter more here 
<textarea rows="3" cols="4">
</textarea>
</div>
</form>


The Problem is if i click on yes, and for some reason i refresh the page, then yes radio button remains checked but moreTxt div hides (i.e. its default visiblity mode) how to tackle with that problem ?
first bump...