HTML Javascript Jquery

JQuery SELECT selectedIndex solution

I swapped what I thought would have been a restful afternoon after looking at A-Level projects with fixing a minor irritating problem with forms.

The problem: JQuery does not copy across the ‘selectedIndex’ of SELECT elements when using clone() or makeArray. In fact it does not appear to copy anything from SELECT elements at all. See

It does however clone values from INPUT and TEXTAREA elements.

Because of the way I traverse through records on a dynamic form to generate JSON data, I needed to implement a solution.

It might not be the best way, but for the time being I simply add a corresponding hidden INPUT element with the same key field as the SELECT element which is used to mirror the value of SELECT. When traversing the ‘records’ it ignores the SELECT values and picks up the value from the hidden INPUT instead. And Voila.

So something initially like this (excuse the rubbish variable names, I know)

Then something like this on the blur event:

Hopefully you get the idea…

Graphics The Learning System

Still using DrawPlus for vectors…

I should probably use a newer program for drawing vector graphics… I even bought Serif’s amazing looking Affinity designer but haven’t made the switch.

I toyed with colour icons but it looked too messy. I revamped the grey icons to pure black. Some students mentioned about having a ‘dark mode’ too. That’s not going to be high on the priority list but I am keeping in mind having different colour modes for viewing accessibility.

Which reminds me of this tutorial I made for students using Gravit…

HTML Javascript Programming

JS JSON-Editor

This week between school hours and sleeping (can’t believe I’ve been surviving on little sleep this week.) I’ve been rewriting my JS JSON editor. Give it an HTML template (with much more attention paid the UI) and some data and it’ll put it in a form… supporting nested arrays. e.g. in the below, new options and questions will automatically generate as you add data. The form data is converted back to JSON and submitted to the server. Pretty cool and highly flexible… minimises any extra coding required for new forms.

JSON Editor