solved it item.customer_id was a int post needed to be passed as an int..
On Friday, June 20, 2014 12:14:18 PM UTC-6, G Z wrote:
>
> Thanks lol its one of those days, I notice i was calling the options the
> name instead of the select.
>
>
> this might be a django ism but after i post the number and try to check it
> with an if statement it doesnt do anythign but if i print both out they are
> the same here is the code
>
>
>> {% if user.is_authenticated %}
>> <h1>Enki-Corp says... hello {{ user.username }}!</h1>
>> {% else %}
>> <h1>Enki-Corp says... hello world!</h1>
>> {% endif %}
>>
>> {% if user.is_authenticated %}
>>
>> <form method='post' action='' id='customers'>
>> {% csrf_token %}
>> <select name='customer_id'>
>> {% for item in customer %}
>> <option value={{ item.customer_id }} >{{ item.customer_name }}</option>
>> {% endfor %}
>> <input type = 'submit' value='Edit'>
>> </select>
>>
>>
>> <table>
>> <tr>
>> <th>ID</th>
>>
>> <th>NAME</th>
>> </tr>
>> <br>
>> {% for item in customer %}
>> {{post}} - {{item.customer_id}} <br> //where I print them out to check
>> if they match when infact there is a matching number it does nothing. but
>> all my if statements below work.
>>
>
>
>> {% if post == item.customer_id %}
>> test
>> <tr>
>> <td valign='top'>{{ item.customer_id }} <a href="{{
>> item.customer_id }}">{{ item.customer_name }}</a>
>> <li>Customer Inactive: {{item.inactive}}</li>
>> </td>
>> <td>
>> {% for group in vm_groups %}
>> {% if item.customer_id == group.customer_id %}
>> {% for vm in vms %}
>> {% if group.vm_group_id == vm.vm_group_id %}
>> <ul>
>> <li>VM Name: {{vm.vm_name}}</li>
>> <ul>
>> <li>VM ID: {{vm.vm_id}}</li>
>> <li>VM Display Name: {{vm.vm_display_name}}</li>
>> <li>VM Group: {{group.vm_group_name}}</li>
>> <li>Vm Mor: {{vm.vm_mor}} </li>
>> <li>Vm Datacenter: {{vm.datacenter_id}} </li>
>> <li>VCD Managed: {{vm.vcd_managed}} </li>
>> </ul>
>> </ul>
>>
>> {%endif%}
>> {%endfor%}
>> {%endif%}
>> {% endfor %}
>> </td>
>> </tr>
>> <tr>
>> <td colspan='2' align='center'> </td>
>> {%endif%}
>> {% endfor %}
>>
>> </table>
>> </form>
>> <a href="/logout/">Logout</a><br />
>> {% else %}
>> You are not authenticated.
>> <a href="/login/">Login</a><br />
>> {% endif %}
>
>
>
>
>
> On Friday, June 20, 2014 12:00:37 PM UTC-6, Tom Evans wrote:
>>
>> On Fri, Jun 20, 2014 at 6:33 PM, G Z <[email protected]> wrote:
>> > I'm trying to post
>> > customer_id
>> > while generating a combo box with a loop from a database query.
>> > I have the combo box generating and such, but the posted data does not
>> > return the customer id. It returns something weird.
>> >
>> >> <form method='post' action='' id='customers'>
>> >> {% csrf_token %}
>> >> <select>
>>
>> Only form elements with names are submitted.
>>
>> Cheers
>>
>> Tom
>>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/bd30d1a8-0b23-4219-9fa4-a7ccc4b9c84f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.