Categories > TinyButStrong general >

function php

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ignacio
Date: 2005-04-08
Time: 00:33

function php

how i do this for template?

<?php SelectBox ("Pais",    "lstPais"); ?>

with this function:

<?php
function SelectBox( $Label, $selectName ){
  ?>
  <tr ALIGN="LEFT">
    <td width="15%"><?php echo $Label ?></td>
    <td align="left">
      <select name="<?php echo $selectName ?>">
        <option></option><option></option><option></option>
        <option>Cargando registros....</option>
      </select>
    </td>
  </tr>
<?php
}
?>

this last function is so dificult for rewrite in templates, i need help!!!

Againg, sorry for my bad english...

Goodbye!
By: Skrol29
Date: 2005-04-08
Time: 01:04

Re: function php

Hi Ignacio,

With templates, this is made by first feeding and empty Html list using MergeBlock(), and then select one or more items in the list using a TBS tag with the special parameter 'selected'.

You'll found a special example for that at the Examples page of this site.
It has many cases illustrated.
By: Ignacio
Date: 2005-04-10
Time: 04:35

Re: function php

I try, I try, I try, but i don't understand how work this...

I made a lot test, but no works! :(:(:(:(

I need more help please, I a newbie with this...

i gonna try to do with templates this scrtipt: http://www.ashleyit.com/rs/jsrs/select/php/select.php

i don't have ideas!!! i'am lost! i'am lost!

?php
  SelectBox ("Pais",    "lstPais");    
  SelectBox ("Provincia",   "lstProvincia");   
  SelectBox ("Ciudad", "lstCiudad");  
?>

<?php

function SelectBox( $Label, $selectName ){
  ?>
  <tr ALIGN="LEFT">
    <td width="15%"><?php echo $Label ?></td>
    <td align="left">
      <select name="<?php echo $selectName ?>">
        <option></option><option></option><option></option>
        <option>--------- Not Yet Loaded ---------</option>
      </select>
    </td>
  </tr>
<?php
}
?>

this code, I have it to do in the page of templates, it can?? i don't know what to do

I try with "onsection", but doesn't work.

Bye!
By: Pirjo Posio
Date: 2005-04-10
Time: 10:20

Re: function php

Like Skrol20 told you, take a look in the Examples you can find in the menu on the first row of this page.
There you find Example with name 'List, radio and checkbox'.

Look at PHP-program, where you need the first example,
which is the first MergeBlock merging 'lst1v'.
And then look in the Html Template Source, where you need the part starting with "Feeding a list" and containing select name 'list_1v'.

First make only your Pais-selection, and when it's working, continue with your other lists.
Hope this helps.
By: Ignacio
Date: 2005-04-10
Time: 20:26

Re: function php

i want use php function in template, is possible??
By: Trent
Date: 2005-04-10
Time: 22:59

Re: function php

You'll never figure out how to do this if you keep asking Skrol TO DO IT FOR YOU!!!!  Read through the examples and check other topics in the forum and I'm sure you'll find your answer.
By: Ignacio
Date: 2005-04-11
Time: 02:25

Re: function php

php
   
function SelectBox( $selectName ){
    return '
    <select class=\"input\" name="'. $selectName .'">
        <option></option><option></option><option></option>
        <option>Cargando registros....</option>
    </select>';
    }
   
$pais = isset($_POST['lstPais']) ? $_POST['lstPais'] : -99;
$provincia = isset($_POST['lstProvincia']) ? $_POST['lstProvincia'] : -99;
$ciudad = isset($_POST['lstCiudad']) ? $_POST['lstCiudad'] : -99;
   
$pais1 = SelectBox ("lstPais");  
$provincia1 = SelectBox ("lstProvincia");
$ciudad1= SelectBox ("lstCiudad");


template
<body onload="preselect('[var.pais;htmlconv=no]', '[var.provincia;htmlconv=no]', '[var.ciudad;htmlconv=no]', 1);" onhelp="jsrsDebugInfo();return false;">

[var.pais1;htmlconv=no]
[var.provincia1;htmlconv=no]
[var.ciudad1;htmlconv=no]

its works!!!!!!!!!!!! thaks for everyone!!