PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Creating Dynamic Forms
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Creating Dynamic Forms

Réponse
 
LinkBack Outils de la discussion
Vieux 14/02/2008, 16h28   #1
chimambo@googlemail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Creating Dynamic Forms

Hello everyone,

I am trying to create a form will populate and display in real time.
For example:

Ln 1. Name: [ ] Sex: [\/] Favourite Sport:
[ ] [Add Button]

Ln2. Peter Jones Male Football
Jack Nickleson Male Baseball
..
..
..

And so on

Where Ln1 is a form with text areas: Name and Favourite sport and
combo box Sex. While the [Add Button] is a button that when clicked
will populate a table and display below the form as shown in ln2
onwards. And once the [Add Button] is clicked, the form clears for
more entries.

Will appreciate your .
  Réponse avec citation
Vieux 14/02/2008, 17h12   #2
Luuk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Creating Dynamic Forms

chimambo@googlemail.com schreef:
> Hello everyone,
>
> I am trying to create a form will populate and display in real time.
> For example:
>
> Ln 1. Name: [ ] Sex: [\/] Favourite Sport:
> [ ] [Add Button]
>
> Ln2. Peter Jones Male Football
> Jack Nickleson Male Baseball
> ..
> ..
> ..
>
> And so on
>
> Where Ln1 is a form with text areas: Name and Favourite sport and
> combo box Sex. While the [Add Button] is a button that when clicked
> will populate a table and display below the form as shown in ln2
> onwards. And once the [Add Button] is clicked, the form clears for
> more entries.
>
> Will appreciate your .


i tried the start for you,
and created an example you should NOT use ;-)

(your webserver should have the right to create 'form.txt' file )

maybe, when you really start TRYING, and give us what you made of it,
someone will you getting this done...

=========< begin of form.php >=====
<html>
<body>
<hr>
<form method=post action=form.php>
Name: <input name=Name value="">
<input type=submit>
</form>
<hr>
<?php
$h=fopen('form.txt','a');
fwrite($h, "Name: ".$_POST["Name"]."<br>\n");
fclose($h);

$x=readfile("form.txt");
?>

</body>
</html>
=========< end of form.php >=====

--
Luuk
  Réponse avec citation
Vieux 15/02/2008, 03h15   #3
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Creating Dynamic Forms

Luuk wrote:
> chimambo@googlemail.com schreef:
>> Hello everyone,
>>
>> I am trying to create a form will populate and display in real time.
>> For example:
>>
>> Ln 1. Name: [ ] Sex: [\/] Favourite Sport:
>> [ ] [Add Button]
>>
>> Ln2. Peter Jones Male Football
>> Jack Nickleson Male Baseball
>> ..
>> ..
>> ..
>>
>> And so on
>>
>> Where Ln1 is a form with text areas: Name and Favourite sport and
>> combo box Sex. While the [Add Button] is a button that when clicked
>> will populate a table and display below the form as shown in ln2
>> onwards. And once the [Add Button] is clicked, the form clears for
>> more entries.
>>
>> Will appreciate your .

>
> i tried the start for you,
> and created an example you should NOT use ;-)
>
> (your webserver should have the right to create 'form.txt' file )
>
> maybe, when you really start TRYING, and give us what you made of it,
> someone will you getting this done...
>
> =========< begin of form.php >=====
> <html>
> <body>
> <hr>
> <form method=post action=form.php>
> Name: <input name=Name value="">
> <input type=submit>
> </form>
> <hr>
> <?php
> $h=fopen('form.txt','a');
> fwrite($h, "Name: ".$_POST["Name"]."<br>\n");
> fclose($h);
>
> $x=readfile("form.txt");
> ?>
>
> </body>
> </html>
> =========< end of form.php >=====
>


And exactly what happens if you have five users running concurrently -
and they all need different forms? This is probably one of the WORST
ways to do this.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 15/02/2008, 03h17   #4
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Creating Dynamic Forms

chimambo@googlemail.com wrote:
> Hello everyone,
>
> I am trying to create a form will populate and display in real time.
> For example:
>
> Ln 1. Name: [ ] Sex: [\/] Favourite Sport:
> [ ] [Add Button]
>
> Ln2. Peter Jones Male Football
> Jack Nickleson Male Baseball
> ..
> ..
> ..
>
> And so on
>
> Where Ln1 is a form with text areas: Name and Favourite sport and
> combo box Sex. While the [Add Button] is a button that when clicked
> will populate a table and display below the form as shown in ln2
> onwards. And once the [Add Button] is clicked, the form clears for
> more entries.
>
> Will appreciate your .
>


Not that hard. Keep track of your list (a good database would be
useful). Get your search criteria and display all entries it finds.

The only hard part is the search criteria - that could be something like
a session id, for instance.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

  Réponse avec citation
Vieux 15/02/2008, 08h46   #5
Luuk
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Creating Dynamic Forms

Jerry Stuckle schreef:
> Luuk wrote:
>> chimambo@googlemail.com schreef:
>>> Hello everyone,
>>>
>>> I am trying to create a form will populate and display in real time.

.....
>>> Will appreciate your .

>>
>> i tried the start for you,
>> and created an example you should NOT use ;-)
>>

.....

>
> And exactly what happens if you have five users running concurrently -
> and they all need different forms? This is probably one of the WORST
> ways to do this.
>



i did warn the OP saying "you should NOT use"
why do you think i did that?

OP is not questioning about concurrent users or databases

OP is even not questioning, he claims to be trying, but the only thing
he tried was putting a message in 'comp.lang.php'

--
Luuk
  Réponse avec citation
Vieux 17/02/2008, 01h40   #6
Jeff North
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Creating Dynamic Forms

On Thu, 14 Feb 2008 08:28:37 -0800 (PST), in comp.lang.php
chimambo@googlemail.com
<c748d382-f6dd-45c1-adf5-cb05c1da7aef@e10g2000prf.googlegroups.com>
wrote:

>| Hello everyone,
>|
>| I am trying to create a form will populate and display in real time.
>| For example:
>|
>| Ln 1. Name: [ ] Sex: [\/] Favourite Sport:
>| [ ] [Add Button]
>|
>| Ln2. Peter Jones Male Football
>| Jack Nickleson Male Baseball
>| ..
>| ..
>| ..
>|
>| And so on
>|
>| Where Ln1 is a form with text areas: Name and Favourite sport and
>| combo box Sex. While the [Add Button] is a button that when clicked
>| will populate a table and display below the form as shown in ln2
>| onwards. And once the [Add Button] is clicked, the form clears for
>| more entries.
>|
>| Will appreciate your .


There are several methods you could use.
Method 1: use an iframe to load the data entry page
Method 2: use Javascript and DOM to dynamically generate the form
Method 3: use php scripting to refresh the page and show the form

Each have there advantages and disadvantages.
-- -------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
-- -------------------------------------------------------------
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17222 seconds with 14 queries