Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've got a slightly complex issue that I feel should be simple enough to resolve, I just seem to be totally stuck.

I've built a site that collects patient and medication data and stores each in a custom post type, using a relationship to assign a patients medication to them. This is achieved using the wp-types plugin to control the CPT's, Gravity Forms to handle the data capture and then wp-views to display the information correctly.

All of this I've got working nicely. The problem arrives when I want to create an ordering system for patients to request their medications.

Gravity Forms cannot dynamically add fields so I cannot use Gravity Forms for anything other than the payment processing as I can simply pass it a number and it's pricing can do the rest.

So what I'm trying to do is add check boxes to the end of each medication entry (View's outputs it as a table in this case) with the intention of allowing users to check the medications they want to reorder and then press a submit (order) button. This will then pass the checked medications to another page by collecting the post id's of each ordered medication and then build the order in another CPT.

The problem is no matter what I do I cannot get the check boxes to do anything!

I've tried various approaches but nothing seems to work. Can anyone suggest anything?

It's running on local so I can't show anyone but if you just work from however you would attempt this we can go from there. Here's how the table looks in the html:

<table class="wpv-grand-listing" width="100%">
        <thead><tr>
           <th><a href="#" class="wpv-header-no-sort" onclick=" return wpv_column_head_click('types-field-medication-name', 'asc')">Name<span class="wpv-sorting-indicator"></span></a></th>
           <th><a href="#" class="wpv-header-no-sort" onclick=" return wpv_column_head_click('types-field-Strength', 'asc')">Strength<span class="wpv-sorting-indicator"></span></a></th>
           <th><a href="#" class="wpv-header-no-sort" onclick=" return wpv_column_head_click('types-field-medication-dosage-instructions', 'asc')">Dosage Instructions<span class="wpv-sorting-indicator"></span></a></th>
           <th><a href="#" class="wpv-header-no-sort" onclick=" return wpv_column_head_click('types-field-Order Quantity', 'asc')">Order Quantity<span class="wpv-sorting-indicator"></span></a></th>
           <th><a href="#" class="wpv-header-no-sort" onclick=" return wpv_column_head_click('types-field-medication-prescribing-doctor', 'asc')">Prescribing Doctor<span class="wpv-sorting-indicator"></span></a></th>
           <th class="white-text">Delete</th>
           <th class="white-text">Order</th>
        </tr></thead>
  <tbody>

        <tr>
           <td class="namestyle"><a href="http://localhost/mydoctorschemist/wordpress/my-settings/edit-medication?bar=no&#038;original_post_id=3032" class="iframeFancybox3">Zoledronic acid</a></td>
           <td>55 Milligrams </td>
           <td>Take ONE tablet ONCE a DAY</td>
           <td>28</td>
           <td>Rankin</td>
           <td class="centre"><a href="http://localhost/mydoctorschemist/wordpress/my-settings/confirm-delete?bar=no&post_id=3032" class="iframeFancybox2 small-button">Delete</a></td>
           <td class="centre"><span><form name="medselection" method="post"><input type="checkbox" name="medcheck" value="3032"></form></span></td>
        </tr>

share|improve this question
1  
That's a js/jQuery question so far - there're solutions out there. Please rework your question to fit into WPSE. The FAQ will help you getting the question on topic. – kaiser Sep 21 '12 at 10:41
Ok, thanks for that. I've actually just managed to figure out a way of doing this differently using Gravity Forms after all but for future reference I'll bare that in mind bud, cheers. – Dave Legassick Sep 21 '12 at 14:21
Please add your solution as answer, so this one doesn't stay open. Thanks. – kaiser Sep 21 '12 at 14:24
1  
I tried adding my solution but it wouldn't let me for x amount of hours then I just tried doing it again and someone's closed the thread so basically the workaround method I found involves this from gravity forms: gravityhelp.com/forums/topic/dynamic-checkboxes-1 – Dave Legassick Sep 23 '12 at 13:37

closed as off topic by kaiser, Wyck, Brian Fegter, Rarst Sep 22 '12 at 14:16

Questions on WordPress Answers are expected to relate to WordPress within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

Browse other questions tagged or ask your own question.