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.

Tags: PHP / Wordpress / Pdf

Similar questions

Only display a certain number of posts, dependent on how many posts there are available in a query
I am trying to write some code for a slider of posts, at the moment my code involves two WP_Querys, one inside the other, but I can't help feeling there may be a more efficient way of doing what I'm trying to achieve. Steps are: Is there any way of doing this without having two WP_Querys? It seems inefficient. Explanation of code here: Thanks!
How to create dependent field in Customizer?
I am trying to have dependent field in Customizer. One field is checkbox Enable Custom Excerpt Length. Another is text field Custom Excerpt Length. I want to implement contextual field using active_callback. I am following this article. https://make.wordpress.org/core/2014/07/08/customizer-improvements-in-4-0/ I am having problem in checking contro...
Check for dependent plugin and if false dont activate plugin
I am creating a plugin for WordPress and this plugin depends on another plugin with a specific version. If I enable my plugin without dependent plugin there are fatal error. Is there a way to check this ? I tried looking at source code but WP do not provide any hook for this. Thanks in advance. --UPDATE-- I am not asking about how to check plugin i...
Category names dependent on each other?
Can someone kindly explain the reason for the following problem? Let's assume you create a category like "sample" for your posts. While editing a post like "Hello World" in Wordpress, you choose both "Uncategorized" and the newly created category. Then in a theme like "Twenty Fifteen", you see both category names under the mentioned post in the hom...
How to display a page dependent on a url parameter supplied by a form/button page?
Here's what I'm trying to achieve: I have a set of PDF files stored in a single directory on the server. Users should be able to enter the id of a file (filename without the extension) and click the Display button. The button should load another page with the file id as a part of the URL. The corresponding PDF file would then be displayed. What is ...
How to create dependent dropdown custom field in wordpress admin post form
I want to create state and city dependent dropdown custom field in WordPress admin post form. So what approach I should follow ? Please suggest.

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.