[Xerte] Re: XOT 101 - Adding HTML/JS to a Text Page

Kent kent_chesnut at hotmail.com
Tue Apr 28 23:43:11 BST 2015


Thanks to all for your input.  A great support forum like this one makes all the difference when it comes to using the product in the real world.  Have a great day.

From: brsmith at akamai.com
To: xerte at lists.nottingham.ac.uk
Date: Tue, 28 Apr 2015 17:29:11 +0000
Subject: [Xerte] Re: XOT 101 - Adding HTML/JS to a Text Page

I’d just like to chime in and say that I’m reading this thread with interest, and looking forward to trying some of this stuff out. From my experience hacking on XOT off and on and following this list for a while now, one of the biggest barriers I’ve encountered to starting to develop my own content types is that doing so seems to be so easy that those who know how take it for granted, and those who don’t remain in the dark about exactly what this easy process entails. ;) 
If/when I get around to trying to create my own content types I’ll try writing up what I learn and submitting it to the wiki on github, but if someone who already knows wouldn’t mind writing up even some basic guidelines including and expanding on what’s come up in this thread, I think it would be a great help to others in the future.
—Brad
On Apr 28, 2015, at 8:24 AM, Smith, John <J.J.Smith at gcu.ac.uk> wrote:Hi,There is a problem with line breaks being converted to <br> tags, usually this is  desirable... inside script tags it is definitely not...My advice Kent would be to learn some jQuery... for your application, in its simplest formAdd up Carbs:<input type="text" id="qty1"/><br><input type="text" id="qty2"/><br><br><br>Total : <input type="text" id="total"/><script>$('input').blur( function() { $('#total').val(Number($('#qty1').val()) + Number($('#qty2').val())); });</script>Paste that into any text box and it should work...Regards,John Smith | Learning TechnologistRoom A250, Govan Mbeki Building | School of Health & Life Sciences | Glasgow Caledonian UniversityCowcaddens Road | Glasgow | G4 0BAPlease address ALL support requests to hlsblt at gcu.ac.uk where one of the School Learning Technologists will pick up the job. This will ensure that all jobs are completed as promptly as possible.________________________________________From: xerte-bounces at lists.nottingham.ac.uk [xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney [Julian.Tenney at nottingham.ac.uk]Sent: 28 April 2015 13:20To: Xerte discussion listSubject: [Xerte] Re: XOT 101 - Adding HTML/JS to a Text PageI put this in an embed Content page and it works – it didn’t work in a plain text page…<p>Adding Numbers</p><input onblur="add();" type="text" id="txt1"/><input onblur="add();" type="text" id="txt2"/><input type="text" id="txt3"/><script>function add(){ alert("adding" + document.getElementById('txt1').value + " and " + document.getElementById('txt2').value);}</script>From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of KentSent: 28 April 2015 12:32To: Xerte ListsSubject: [Xerte] XOT 101 - Adding HTML/JS to a Text PageI 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,KentThis message and any attachment are intended solely for the addresseeand may contain confidential information. If you have received thismessage in error, please send it back to me, and immediately delete it.Please do not use, copy or disclose the information contained in thismessage or in any attachment.  Any views or opinions expressed by theauthor of this email do not necessarily reflect the views of theUniversity of Nottingham.This message has been checked for viruses but the contents of anattachment may still contain software viruses which could damage yourcomputer system, you are advised to perform your own checks. Emailcommunications with the University of Nottingham may be monitored aspermitted by UK legislation.Glasgow Caledonian University is a registered Scottish charity, number SC021474_______________________________________________Xerte mailing listXerte at lists.nottingham.ac.ukhttp://lists.nottingham.ac.uk/mailman/listinfo/xerteThis message and any attachment are intended solely for the addresseeand may contain confidential information. If you have received thismessage in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in thismessage or in any attachment.  Any views or opinions expressed by theauthor of this email do not necessarily reflect the views of theUniversity of Nottingham.This message has been checked for viruses but the contents of anattachment may still contain software viruses which could damage yourcomputer system, you are advised to perform your own checks. Emailcommunications with the University of Nottingham may be monitored aspermitted by UK legislation.


This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it. 

Please do not use, copy or disclose the information contained in this
message or in any attachment.  Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20150428/68ba56ad/attachment-0001.html>


More information about the Xerte mailing list