Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
[HTML issue] Table, Calculator Help
Post Flair (click to view more posts with a particular flair)
Author Summary
naixram is in HTML issue
Post Body

I have figured out most of my table, but I still have a few small issues.

Edit: Fixed Problem One, See comments! 1) When I press the "Calculate" button, if there is already numbers in the Cost of batch box then it will not calculate. (So how do i make the program clear that field on button press)

2) The most frustrating one for me thus far I cannot figure out how to edit the width of the boxes (ie. The boxes with the number fields) and if possible center the numbers in the boxes. (Soo frustrating because it seems so simple)

I have a few more questions, but I want to try and figure them out before I ask for help!

<!DOCTYPE html>

<html lang="en"> <head> <meta charset="utf-8" /> </head>

<body>

<form id="lemon" action=""> <fieldset> <legend>Help Me Por Favor</legend> <table> <tr> <td> <input type="submit" value="Calculate" />

</td>

<td><center>
    Amount Used
</center></td>
<td>
    Amount Purchased
</td>
<td>
    Cost of Purchase
</td>
<td>
    Cost of Batch Made
</td>

</tr> <tr>

<td>
    Lemon Juice (oz)
</td>
<td>
    <input id="lau" name="lau" type="number" value="18"/>
</td>
<td>
    <input id="lap" name="lap" type="number" value="2270"/>
</td>
<td>
    <input id="lcp" name="lcp" type="number" step="0.01" value="37.00"/>
</td>
<td>
    <input id="lcb" name="lcb" type="number"/>
</td>

</tr> </table> </fieldset> </form>

<script> (function () { function calculateLemon(lau, lap, lcp) { lau = parseFloat(lau); lap = parseFloat(lap); lcp = parseFloat(lcp); return ( ( lau / lap) * lcp); }

var lemon = document.getElementById("lemon");
if (lemon) {
    lemon.onsubmit = function () {
        this.lcb.value = calculateLemon(this.lau.value, this.lap.value, this.lcp.value);
        return false;
    };
}

}()); </script>

</body> </html>

Author
Account Strength
90%
Account Age
12 years
Verified Email
Yes
Verified Flair
No
Total Karma
583
Link Karma
398
Comment Karma
170
Profile updated: 23 minutes ago
Posts updated: 4 months ago

Subreddit

Post Details

Location
We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
8 years ago