hello
I saw on topic " how to disable add button after record added " this :
List page: Before display event on the Events tab for this purpose.
Here is a sample:
$rstmp = CustomQuery("select count(*) as count_R from TableName");$datatmp = db_fetch_array($rstmp);if ($datatmp["count_R "]>1)$xt->assign("add_link",false);
It might be something I'm looking for.
Here is the thing. people do a record on my table but they don't connect from addpage directly but from an external pages.
So they connect throught something like : www.com/mytable_add?iduser=3&idcompagny=8&from=external
The thing is I want them to use this and not connect trought the add function within phprunner.
So I put a little code in events " before display". on this I put a if $GET"from"= external : return true, else return false and print " please use formular from www.something.com".
Problem is when user click on add, then it reload the page, hence it reload the event before display, hence it shows the error because of course the reloading is from within phprunner and the "from=external" is not loaded this time.
how can I avoid to have the if GETfrom=external not checked on after add reload ?
Or maybe a simpler thing would be to do in after record: location header to redirect to list view. But then there is no way of telling user quickly " record added " in green.
What code should I use to manually get the " record was addes succesfully" on my after record event? is there a check function I can call in the after record added that will return true if no problem happened? So user could see that the record is added and then with something like a sleep (3) redirect to list page.
thank you.