Forums

Getting a data-view in the front end

kleeflang 28 Mar, 2008
Hello,

Is there someone who knows how to easily show the form table (the entries of a form) in the front end?

And is there a way to re-open a once filled form to change it?

I can code a little php if needed.

I know this might have been asked before, but I can't find anything on it.


Thank you,

Krijn<br><br>Post edited by: kleeflang, at: 2008/03/28 15:33
GreyHead 29 Mar, 2008
Hi Krijn,

The Profile PlugIn will let you create a single record from any database table in the front end. If you want more than one then you'd need to code the table yourself.

To re-open a form you'd need to look up the record in the database table and set the values of the fields from it. Not very difficult but has to be coded.

Bob
kleeflang 17 Apr, 2008
Hello Bob,

Is there any how-to on this plugin, because I'm having a hard time getting it to work.

Thank you,
Krijn
GreyHead 18 Apr, 2008
Hi Krijn,

No, I'm afraid there isn't at the moment. Just a few posts in the Forums here. It's on the To_Do list for both Max and I as soon as there's a few hours free.

Bob
kleeflang 18 Apr, 2008
Hi Bob,

I've got things to work a bit now, but I still need some help.
I made my own list view of records for the database.
Now I want users to be able to choose a record for editing according to the list.
The profiles plugin is working now, so I've got most covered.
Only thing is, I use radiobuttons, checkboxes etc.
Now how do I get that value from the {} back into a chosen box?
I mean, I don't think <?php if({mycheck} == "checkme" ?> will work or will it?

Thanks again,

Krijn
GreyHead 18 Apr, 2008
Hi Krijn,

Here's a chunk of code I've written to do this for Yes/No radio buttons. I'm sure that it can be adopted for checkboxes and otehr radio button configs:
<?php
$checked = "checked='checked'";
// set up an array of radio button names
$q_array = array('q1', 'q2', 'q3');
// loop through the array 
// creating a smaller array for each pair of buttons
foreach ($q_array as $q) {
  $$q = array();
  ${$q}['y'] = ${$q}['n'] = "";
  if ( $_POST[$q] == 'yes' ) {
    ${$q}['y'] = $checked;
  } elseif ( $_POST[$q] == 'no' ) {
    ${$q}['n'] = $checked;
  }
}
?>
and the input tag looks like
<input type="radio" name="q1" value="yes" <?php echo $q1['y']; ?> />
<input type="radio" name="q1" value="no" <?php echo $q1['n']; ?> />
Bob<br><br>Post edited by: GreyHead, at: 2008/04/18 15:37
This topic is locked and no more replies can be posted.