Hi
Thanks for the reply
I have messing about a little with jquery today.
With some success, then not with others.
I put this code in a js file.
function DoAction( id )
{
$.ajax({
type: "POST",
data: "id=" + id,
});
}
and this code in my view.
{{for r in row:}}
<a href="#" OnClick="DoAction('{{=r.upn_no}}');" > Click </a>
{{}pass}
This sends a number to a test1 controller, which works.
I use number in the controller, to get info from a db. eg. get a row id based on the number.
Then insert some data in a db after some checks.(got some parts working)
After that I want to redirect to a another page, is that possible.
Bear in mind that when I send the number via jquery to the controller it does it in the background,
it doesn't change page.
What I'm trying todo is as follows.
I have a search page, which searches the database for a person based on a number.
This then brings back the users name onto a results page.
I would then click on the user name which then registers the person in the database into
another table with the room and period.
This is what it does in the background.
It checks to see if that person is already in the a room with that period, if false it puts them in the room.
then goes back to the search page.
If true it goes back to the search page without adding the person.
This stops you registering the same person in the same period.
Ive done this in codeigniter php framework with no problems.
I want do it in web2py, this seems a lot less code for what I have archieved so for, plus
its a good way to learn web2py and find the good and things and limitations if any.
Thnaks