$init_textbox=array("one","two","three");
// only do this once
$f->add_element($f->add_element(array("type"=>"text",
"name"=>"textbox",
"value"=>$init_textbox,
"multiple"=>1));
$f->start();
$f->show_element("textbox");
$f->show_element("textbox");
$f->show_element("textbox");
$f->finish();
or if you want to retain previously posted values after form submission,
(i.e $textbox = array("one", "two", "three"). You can call
$f->load_defaults();
Regards,
-Stewart.
-----Original Message-----
From: Rob [mailto:rm...@le...]
Sent: 01 May 2003 17:13
To: php...@li...
Subject: [Phplib-users] oohforms - Any one use multiple with type=text
successfully?
Hi,
I still haven't figured out how to make this work. I've traced through the
code and I think there's an "ob" array member that never gets set. I'm
thinking it needs to be set for this to work.
If anyone can show me an example of text & multiple in the same page that
set and then display values, that might help me uncover the problem of how
it is supposed to work.
-Thanks, Rob
Previous example:
Test code:
<?php
error_reporting (E_ERROR | E_WARNING | E_PARSE);
require("oohforms.inc");
$f = new form;
$f->add_element(array("type"=>"text",
"name"=>"textbox",
"value"=>"first 1111",
"multiple"=>1));
$f->add_element(array("type"=>"text",
"name"=>"textbox",
"value"=>"second 2222",
"multiple"=>1));
$f->start();
$f->show_element("textbox");
$f->show_element("textbox");
$f->finish();
?>
HTML output (is):
<form name='' method='POST' action='/p/testmulti.php' target='_self'>
<input name='textbox[]' value="second 2222" type='text'>
<input name='textbox[]' value="second 2222" type='text'>
</form>
HTML output (should be):
<form name='' method='POST' action='/p/testmulti.php' target='_self'>
<input name='textbox[]' value="first 1111" type='text'>
<input name='textbox[]' value="second 2222" type='text'>
</form>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Phplib-users mailing list
Php...@li...
https://lists.sourceforge.net/lists/listinfo/phplib-users
|