|
Posted by Jerry Stuckle on 04/13/06 23:25
Garry Jones wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> skrev i meddelandet
> news:1cydncizcunm8aPZnZ2dnUVZ_uudnZ2d@comcast.com...
>
>
>>Sjoerd is correct - you really want to use arrays. They're much easier
>>than your route, and the code much cleaner.
>
>
> I have looked at arrays. My problem is that some people only enter their
> christain name and leave the surname blank. Other strange user combinations
> are possible, people can jump to a lower place in the form and use the forth
> group of input fields for the third person for instance.
>
> As I am reading in up to 8 values for each person I saw that I was going to
> have to synchronise the input if I use arrays. Data entered into each of the
> groups of fields has to be kept together. As I am new to arrays and have
> already got the code sorted out I thought a variable name would be the
> simpliest way of doing this.
>
> However, sticking ones head in the mud and refusing to adapt to the correct
> tool for the job never pays in the long term. So a few tips about keeping
> input data in groups so that an array reading does not group together the
> information from different groups of fields would come in very handy for me.
>
> Garry Jones
> Sweden
>
>
Garry,
OK, in that case name you fields with the array index, i.e.
<type=input, name="personage[1]" ...
<type=input, name="personage[2]" ...
This works just as well.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|