[Xerte] XOT 101 - Adding HTML/JS to a Text Page
Kent
kent_chesnut at hotmail.com
Tue Apr 28 12:31:37 BST 2015
I need a page with a few input fields. I want to sum the numbers from the fields into a total field. Easy enough to add the fields to a Text page by putting the following into the "Page Text" field.
Add up Carbs:<input onblur="findTotal()" type="text" name="qty" id="qty2"/><br><input onblur="findTotal()" type="text" name="qty" id="qty2"/><br><br><br>Total : <input type="text" name="total" id="total"/>
To define the FindTotal() routine, I need to add a <script> section.
<script type="text/javascript"> function findTotal(){ // some JS code here }</script>
As soon as I add the script section, the fields will no longer show up when I press Play. I'm not sure what I'm doing wrong.
Any advice would be much appreciated.
Have a great day,
Kent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20150428/14f9ee6f/attachment.html>
More information about the Xerte
mailing list