Forums

Can anyone convert this to a plugin (2 posts)

  1. barry4821
    Member
    Posted 5 years ago #

    I have this PHP file which I would love to create into a plugin. Can anyone do this?

    <script type="text/javascript">
    <!--
    function calculate() {
    var doc = document.pointCalc;
    var points = 0;
    var fiber = doc.fiber.value;
    var fat = doc.fat.value;
    var calories = doc.calories.value;
    points = (calories / 50) + (fat / 12) - (fiber / 5);
    doc.result.value = Math.round(points);
    }
    // -->
    </script>

    <form name="pointCalc">
    <table><tr>
    <tr><td>Calories:</td><td><input type="text" name="calories"></td></tr>
    <tr><td>Fat:</td><td><input type="text" name="fat"></td></tr>

    <tr>
    <td>Fiber:</td>
    <td>
    <select name="fiber">
    <option value="0">0</option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4 or more</option>
    </select>
    </td>
    </tr>

    <tr><td colspan="2"><input type="button" value="Calculate" onClick="calculate();"></td></tr>
    <tr><td>POINTS:</td><td><input type="text" name="result"></td></tr>

    </table>
    </form>

  2. jwurster
    Member
    Posted 5 years ago #

    How do you want to use this? You probably don't need a plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags