Display the SAVE button if ...

I need to show the Save Button only if document.form1.TotalTendered.value is greater than or equal to document.form1.InvoiceTotal.value.
Who is Participating?
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
ok so it'll need to be done via javascript. this is untested but should work for you...

<script language="javascript">
   function displaySaveButton() {
       if( document.frm.TotalRendered.value != '' && document.frm.InvoiceTotal.value != '' ) {
           if( document.frm.TotalRendered.value >= document.frm.InvoiceTotal.value )
               document.getElementById('spnSaveButton').style.display = 'block';
               document.getElementById('spnSaveButton').style.display = none';
       } else    //-- hide save button if both fields are blank
               document.getElementById('spnSaveButton').style.display = none';

<form name="frm" method="post">
   <input type="text" name="TotalTendered" value="" onchange="return displaySaveButton();" />
   <input type="text" name="InvoiceTotal" value="" onchange="return displaySaveButton();" />

   <span id="spnSaveBtn" style="display:none;>
        <input type="submit" value="Save" />
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
do you want to do this in asp or javascript? if its asp (meaning you have the value BEFORE the page loads), then it can be done quite easily
drelingerAuthor Commented:
I won't have the value before the page loads...
drelingerAuthor Commented:
...you got me there.. thank you...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.