Getting a data-view in the front end

Post any questions you may have here

Getting a data-view in the front end

Postby kleeflang on Fri Mar 28, 2008 7:30 pm

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
kleeflang
Fresh Boarder
 
Posts: 6
Joined: Fri Mar 28, 2008 10:16 am

Re:Getting a data-view in the front end

Postby GreyHead on Sat Mar 29, 2008 4:48 am

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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3461
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Getting a data-view in the front end

Postby kleeflang on Thu Apr 17, 2008 9:34 pm

Hello Bob,

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

Thank you,
Krijn
kleeflang
Fresh Boarder
 
Posts: 6
Joined: Fri Mar 28, 2008 10:16 am

Re:Getting a data-view in the front end

Postby GreyHead on Fri Apr 18, 2008 4:13 am

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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3461
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Getting a data-view in the front end

Postby kleeflang on Fri Apr 18, 2008 5:28 pm

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
kleeflang
Fresh Boarder
 
Posts: 6
Joined: Fri Mar 28, 2008 10:16 am

Re:Getting a data-view in the front end

Postby GreyHead on Fri Apr 18, 2008 7:34 pm

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:
Code: Select all
<?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
Code: Select all
<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
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3461
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms Questions & Answers

Who is online

Users browsing this forum: Google [Bot], MSN [Bot], Yahoo [Bot] and 2 guests