Search form to show the record in form view

pkjoshi

Active Member
Is it possible & how, I can make search form to redirect to the detailed view of the record instead of the list view.

for example I have created a list of students with their grade in the list and a search form, which work fine, if I enter the roll number of the student, the list is shown with only the roll number entered for the student.

What I want is that instead of showing the list it show the record in detailed view instead.
 
Is the 'roll number' guaranteed to be a unique key, i.e. only one row in your student table will have that number?

If so, instead of redirecting to the list page from your form submission redirect plugin, you could redirect to the detail view of the form like this:

Code:
index.php?option=com_fabrik&view=details&formid=123&rowid={___roll_number}&usekey=roll_number

eplace 123 with your actual numeric form ID.

Replace ___roll_number with whatever the full element ID for the roll number is on your search form.

Replace the last roll_number with whatever the short element name (i.e. without the table___ prefix) of the roll number is on the student form.

Turn off 'use as search form' (or whatever that option is called on the redirect plugin, I forget).

Of course, this assumes that roll number is the ONLY thing you are searching on from the search form.

If it isn't, and you only want to do this version of the redirect if a roll number is provided, you'd have to have two redirect plugins, with condition code that check to see if {___roll_number} is empty on the search form submit, which run either the list search redirect if it isn't, and the details redirect if it is.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top