Info regarding Multipage plugin

ITPlaza 09 Mar, 2011
Hi all I need you help.
I make a multipage procedure.
In the first form I've only a text field and submit button with no extracode.
The value of the textbox is varchar and I need in the second form, to match it with record in DB (varchar too).
I'm using the $posted method but still no results.
Can you help me?
Here is the code of the second form
<?php
$session  =& JFactory::getSession();
$posted = $session->get('chrono_formpages_data', array(), md5('chrono'));

$db =& JFactory::getDBO();
$query = "
 SELECT cod_art, desc_art
 FROM `#__chronoforms_form_articoli` WHERE `cod_art` =".$posted['cod_articolo'];
echo $posted['cod_articolo'];
 
$db->setQuery($query);
$nomes = $db->loadAssocList();
 
foreach ( $nomes as $v ) {
 $articolo1 = $v['cod_art'];
 $descrizione =  $v['desc_art'];
 
}
?>
<div class="form_item">
  <div class="form_element cf_heading">
    <h1 class="cf_text">Scelta articolo</h1>
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Codice Articolo</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_1" name="cod_art_tmp" type="text" value="<?php echo $articolo1;?>" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Descrizione Articolo</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_2" name="desc_art_tmp" type="text" value="<?php echo $descrizione;?>" />
  
  </div>
  <div class="cfclear"> </div>
</div>

<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Quantità</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_3" name="qta_art_tmp" type="text" />
  
  </div>
  <div class="cfclear"> </div>
</div>
<div class="form_item">
  <div class="form_element cf_button">
    <input value="Invia" name="button_4" type="submit" /><input type="reset" name="reset" value="Reset"/>
  </div>
  <div class="cfclear"> </div>
</div>
GreyHead 09 Mar, 2011
Hi ItPlaza,

That all looks good to me.

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
ITPlaza 09 Mar, 2011
PM sent thanks in advance🙂
GreyHead 09 Mar, 2011
Hi ItPlaza,

Fixed I think, there were two problems
[list=a]
  • You had a second hidden input in the first step form (ricerca) that had the same name as the main input but no value -- this was overwriting the entered value

  • The code to get the $posted array is no longer needed, ChronoForms makes it available for you so you can just use $posted['input_name']
  • [/list:o]

    Bob
    ITPlaza 09 Mar, 2011
    Hi Bob, first of all let me thank you for help, but I'm still having a problem.
    The passage of text from a form to another works now but in the select form of the second form seems it won't work.
    GreyHead 09 Mar, 2011
    Hi ITPlaza,

    Puzzled?? There isn't a select on the second form. The steps are ricerca, figlio2, figlio3, figlio4, figlio5 The select is on figlio1

    Bob
    ITPlaza 09 Mar, 2011

    Hi ITPlaza,

    Puzzled?? There isn't a select on the second form. The steps are ricerca, figlio2, figlio3, figlio4, figlio5 The select is on figlio1

    Bob


    Ok my bad (my english is bad I know).
    When I talk about select I mean the query in figlio2🙂
    $query = "
    SELECT cod_art, desc_art
    FROM `#__chronoforms_form_articoli` WHERE `cod_art` =".$posted['cod_articolo'];
    echo $posted['cod_articolo'];
    GreyHead 09 Mar, 2011
    Hi ITPlaza,

    Ohhh, sorry.

    The value of cod_articolo is a string (not an integer) so it has to be quoted in the query
    WHERE `cod_art` = '".$posted['cod_articolo']."'";

    Bob
    ITPlaza 09 Mar, 2011
    Bob
    it works!
    Thanks again and, of course, I owe you a beer ^^
    This topic is locked and no more replies can be posted.