Visible button after update in form elements

M

Mr. Smith

Hi.
I have a form with three <textarea> and one <input> element. When either of
these are changed I want an "Update" button to be visible at the bottom of
the form. I've tried this:

On every element I've added this trigger:
onChange='jsVwBtn()'

Function like this:
function jsVwBtn()
{document.form1.btnupdate.type = "button";}

Default the btnupdate type is set to "hidden".

Some of you might start to laugh now, but as you continue do that please
give some "state of the art" way to do this.....

Regards
Mr. Smith
 
J

John Beschler

Try this:
<table width=400 cellpadding=0 cellspacing=0 border=1>
<form name="frmMain" method="post">
<tr>
<td width="100%" align="center">
<textarea cols="60" rows="10" name="txt1"
onChange="txtonChange()"></textarea>
</td>
</tr>
<tr>
<td width="100%" align="center">
<textarea cols="60" rows="10" name="txt2"
onChange="txtonChange()"></textarea>
</td>
</tr>
<tr>
<td width="100%" align="center">
<textarea cols="60" rows="10" name="txt3"
onChange="txtonChange()"></textarea>
</td>
</tr>
<tr>
<td width="100%" align="center">
<input type="button" name="btnOne" value="update" style="visibility:
hidden;">
</td>
</tr>
</form>
</table>


</body>
</html>



<script language=javascript>
function txtonChange()
{
document.frmMain.btnOne.style.visibility = "visible"
}

</script>
 
M

Mr. Smith

My man!

Thanks a lot.

Mr.Smith
John Beschler said:
Try this:
<table width=400 cellpadding=0 cellspacing=0 border=1>
<form name="frmMain" method="post">
<tr>
<td width="100%" align="center">
<textarea cols="60" rows="10" name="txt1"
onChange="txtonChange()"></textarea>
</td>
</tr>
<tr>
<td width="100%" align="center">
<textarea cols="60" rows="10" name="txt2"
onChange="txtonChange()"></textarea>
</td>
</tr>
<tr>
<td width="100%" align="center">
<textarea cols="60" rows="10" name="txt3"
onChange="txtonChange()"></textarea>
</td>
</tr>
<tr>
<td width="100%" align="center">
<input type="button" name="btnOne" value="update" style="visibility:
hidden;">
</td>
</tr>
</form>
</table>


</body>
</html>



<script language=javascript>
function txtonChange()
{
document.frmMain.btnOne.style.visibility = "visible"
}

</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top