Jump to content

Undetermined number of data items, what is best method of input?


Guest kilbad

Recommended Posts

This is a repost from another phpfreaks forum section, but I was told that AJAX might be the solution..

 

I have a type of data (medication names) that I want a user to input into a form, and then have those medications listed in a MySQL db in separate columns for each particular patient; so one row would look like:

 

Patient's Chart Number | first medication | second medication | third medication | and so forth..

 

My question is this: What is the best way, using PHP and/or javascript to have a user input multiple medications in a form when there is a different/undetermined number of medications that will need to be entered for each patient.  I don't want to have a form with a absolute number of text input fields because what if there are more medication than fields?  I also do not what to delimit the data in a single input field with spaces, commas, etc, because each medication will also have additional input fields that will need to be filled out (frequency, dosage).

 

Any ideas?  I just want to make sure I am smart about the way I do this.

 

Let me know if you need any clarification on what I have written.  Thank you all so much in advance!

 

Brendan

Link to comment
Share on other sites

  • 1 year later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.