User input dependent table
I've setup a wordpress blog, www.akutbarn.dk, with the intention of offering medical advice to colleagues looking after critically ill children. I'd like it amongst other things to feature a table of common drugs to draw up that would take 'weight of child' as input. In a high stress situation this is fraught with danger of factor 10 errors and such, so needs to be simple and straightforward.
Requirements: - visually uncluttered - needs to work on most OSs and preferably older browsers. Ipad is a another user scenario - needs to validate input - needs to print reliably to A4 for the nurse to bring to drug prep area - needs to control layout on screen and on paper
Retrieval services offer interactive pdf's for this, such as this: site.cats.nhs.uk/wp-content/uploads/2012/08/dgh_drugcalculator_v1.1.pdf
This secures control of layout nicely, but layout and coding requires proprietary software and is quite laboursome and slow. I thought it'd be cleaner to run it in something more web native. I've toyed with embedding an interactive google sheet (https://docs.google.com/spreadsheet/pub?key=0AiW9rByG5WusdC1jWnhHaDYwUzd0a0N5dHhnMmljOEE&gid=1). It's still very rough, but you get the idea. The problem though is than an entered weight carries over to whoever accesses the site next which is unacceptable and accessing the sheet simultaneously would be disastrous.
I suppose a php/mysql kind of setup could sort out the interactive bid and populate a table, but honestly I wouldn't know where to start.
Apart from a bit of JS/HTML/CSS tutorials on codeacademy I'm new at coding.
Previous suggestions in another forum: https://productforums.google.com/forum/#!mydiscussions/docs/QKc4T08QdXA
Any suggestions?
Cheers, Mads
Solutions
You can start by learning a bit of php. For this you will need some simple stuf like creating forms and then returning the result.
You can have some inputs on a page like:
<form action="result.php" method="post">
Age: <input type='text' name='age' id='age'>
Weight: <input type='text' name='weight' id='weight'>
<input type="submit" name="submit" value="Submit">
These fields are in a form that post to a page where you calculate the output.
<?php
$age=$_POST['age'];
$weight=$_POST['weight'];
$result=$age*$weight;
echo $result;
?>
You've got the ideea. But for this you have to learn some basic php to understand what you are doing.
Hope it helps.