• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

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
0
drelinger
Asked:
drelinger
  • 2
1 Solution
 
iusephpCommented:
When exactly you are planning to hide this?
Only only Body onload we can access input fields.
so add an eventlistener  to body onload
0
 
drelingerAuthor Commented:
I would like the button hidden until document.form1.TotalTendered.value is greater than or equal to document.form1.InvoiceTotal.value - the user will enter values, when the TotalTendered field exceeds the InvoiceTotal, then I want them to be able to Click Save...
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
you should probably request this question be deleted since its a duplicate of this one:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_27032688.html?cid=1131

unless your're still having problems that is...
0
 
iusephpCommented:
in that case you can keep a function which will trigger for each key input
something like

function displaySave(){

if(document.form1.TotalTendered.value => document.form1.InvoiceTotal.value){
      document.form.saveBtn.style.display='';
}else{

document.form.saveBtn.style.display='none';
}

}


<input name='TotalTendered' onkeyup='displaySave()'></input>
<input name='InvoiceTotal' onkeyup='displaySave()'></input>

<input type='button'  name='saveBtn' value='SAVE' style='display:none'></input>



//you can optimise your code further
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now