determine number of entries Options (2)
- From: question.boy@xxxxxxxxxxx
- Date: Thu, 31 Jan 2008 05:20:05 -0800 (PST)
This is a followup to a previous question.
I have a form with a series of sequentially named input controls
<input type='text' name='IngQty1'
onChange='javascript:saveValue(1,this.value)'>
<input type='text' name='IngQty2'
onChange='javascript:saveValue(2,this.value)'>
<input type='text' name='IngQty3'
onChange='javascript:saveValue(3,this.value)'>
....
I am trying to count the number of instances of inputs IngQty# and
also loop through the values.
In a response (see http://groups.google.com/group/php.general/browse_thread/thread/fee556be7bdf79f1#b80f072bf291bda4)
I got previously I was given the following
foreach($_SERVER['POST']['foo'] as $key => $value) {
//do something with each one
}
count($_SERVER['POST']['IngQty'])
but it doesn't work (I should rephrase that and say I can't get it to
work).
The for each generates a "Warning: Invalid argument supplied for
foreach()" and the count always returns a value of 0.
Could someone help me get these functional.
Thank you for the help!
QB
.
- Follow-Ups:
- Re: determine number of entries Options (2)
- From: ZeldorBlat
- Re: determine number of entries Options (2)
- Prev by Date: Re: [PHP] Another question about functions...
- Next by Date: Re: [PHP] Another question about functions...
- Previous by thread: PEAR website and MSIE 6
- Next by thread: Re: determine number of entries Options (2)
- Index(es):