Forums

Editing 1 field of a table using primary key

daviddrennan 24 Feb, 2012
Hi everybody,

I have a form where people can order something. Then when they are finished ordering
they can see the orders table on the screen with their new order. However the approval button
field will only have pending inside it. Then someone can go from the notification mail to the approval form. Where they type the order number in one field and then select approved or not approved
The only problem is i dont know how to set the condition that the correct approval field
is selected. Can anyone help?

Br,

David
GreyHead 25 Feb, 2012
Hi David,

If I understand correctly you want to send an approval notification email that will link back to the approval form and load the correct record?

I'd add a unique ID* to the transaction (rather than use the record ID) and include that in the url in the email with &id=xxxxx

Bob

* I have an action for that here
daviddrennan 25 Feb, 2012
Hi Bob,
Thanks for the quick reply-

No I wish for the email to link to a url with an acceptance form. This will have one field to enter the record number(There is a table on the page, so that the user can see the record to update), And another field which has the accepted or not accetpted dropdown selection box. So what I want to do is have the submit button update the row and acceptance field where the record number matches.

Br,
David.
GreyHead 25 Feb, 2012
Hi David,

I think that's the question that I tried to answer - though why would you have the user type in a number when you can do it automatically for them?

Bob
tfk 27 Feb, 2012
Bob,
This seems to be a solution for I want to do, which is to set up a form that allows registered users on my site to submit a vote from a form with radio buttons--and vote only once.

I have two or three questions:
--Will it work? (If there's a better way, could you point me in the right direction?)
--Should I have the load_user_info_gh folder already? (I don't)

I'm using the Chronoforms V4 on Joomla 2.5.

Thanks,
Walt
GreyHead 27 Feb, 2012
Hi Walt,

If they are going to be logged in to vote then save the voting results including their User iD to a table and - when the form loads - check the table. If they already have an entry don't show the form HTML, just a message to say they have already voted.

Not sure how this linked to the email though.

Bob

You probably don't need to the Load User Info [GH] action for this: if you do then you can install it with the Install Action icon on the Forms Manager toolbar from CFV3.0 or later.
daviddrennan 27 Feb, 2012
Hi Bob,

I think I have not explained it properly. Once the order is entered using the first form. An email will be sent to the person who will process the order.

This person must then follow the link in the email to a new form. There she must type in the order number and then select yes. What I dont know how to do is to update a specific row based on the ordernumber.

Br,

David.
tfk 27 Feb, 2012
Thanks, Bob, I was thinking that I needed to have a primary key. Thanks for pointing out the easy way (I've documented db systems as a technical writer, but I've managed to avoid working with them until now, so I'm glad you work for beer🙂 .)
tfk 05 Mar, 2012
Bob,
Can you point me to the easiest way to check the table to see if the user has submitted a vote already?

Thanks--and my apologies for hijacking the thread😑 . I hope that David's questions have been answered.
This topic is locked and no more replies can be posted.