I mean the code that is generated from your PHP code when you view the source in the browser.
Sum the value
Collapse
X
-
Here it is...
Code:<tr><td width='50%'>Organizations</td><td width='67%'><Input type = 'text' Name ='totalOrganizations' id ='totalOrganizations' value='' onkeyup='if ((document.getElementById('totalOrganizations').match(/^[0-9]+$/) && document.getElementById('totalAgencies').value.match(/^[0-9]+$/))) document.getElementById('Total').value = parseInt(document.getElementById('totalOrganizations').value)) + parseInt(document.getElementById('TotalAgencies').value); else document.getElementById('Total').value = '';> </td></tr><tr><td>Agencies</td><td width='67%'><Input type = 'text' Name ='totalAgencies' id='totalAgencies' value='' onkeyup='if ((document.getElementById('totalAgencies').match(/^[0-9]+$/) && document.getElementById('totalOrganizations').value.match(/^[0-9]+$/))) document.getElementById('Total').value =(document.getElementById('totalOrganizations').value) + parseInt(document.getElementById('totalAgencies').value); else document.getElementById('Total').value = '';> </td></tr>Grand Total <input type = 'text' value ='' name ='Total' id='Total' >Comment
-
Do you mean by doing this (see onkeyup)
<Input type = 'text' Name ='totalAgencies ' id='totalAgenci es' value='$row[Total]'
onkeyup=\"if ((document.getE lementById('tot alAgencies').ma tch(/^[0-9]+$/) && document.getEle mentById('total Organizations') .value.match(/^[0-9]+$/)))
document.getEle mentById('Total ').value =(document.getE lementById('tot alOrganizations ').value) + parseInt(docume nt.getElementBy Id('totalAgenci es').value);
else document.getEle mentById('Total ').value = ''\";>Comment
-
Try this:
Code:<Input type = 'text' Name ='totalAgencies' id='totalAgencies' value='$row[Total]' onkeyup='setTotal()'/>
Code:function setTotal() { if ((document.getElementById('totalAgencies').match(/^[0-9]+$/) && document.getElementById('totalOrganizations').value.match(/^[0-9]+$/))) { document.getElementById('Total').value = parseInt(document.getElementById('totalOrganizations').value) + parseInt(document.getElementById('totalAgencies'). value); } else { document.getElementById('Total').value = ''; } }Comment
Comment