Reply to Re: dynamically creating a input box, can this be done?

Your name:

Reply:


Posted by Cal Lidderdale on 07/22/05 00:33

jj wrote:
> hello everyone,
>
> Im going to try to simplify my problem as much as i can:
>
> Lets say I have a single form element (an input box).
> and a button next to it. I would like this button when pressed to create a
> second input box and second button right below that one (exactly the same
> button and input box). Then if i were to press that second button, a third
> row of input box and button would be created below, and so on and so on.
>
> Can any one shed some light for me how i would go about doing this?
>
> Thanks.
>
>
This will be high level
---------------------------------------------
<form action=thisscript.php method=get>
<? php

$list = array (var1, var2, var3...);
foreach ($list as $item) { $$item = $_GET ["$item"]; }

if ( $var1 == "" ) {
do xyz - build textbox(var1) ...;
}

if ( $var2 ... } {
reload textbox1(var1) - create box2(var2) ...;
}

etc;
?>
<input type=submit value=Submit>
</form>
----------------------------------------------

Just have the script call itself.
if var1 == null create textbox-1
else recreate box1 from var1 & if var2 == null create box2
else box1, box2 create box3
else box1, box2, box3, create box4.........

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация