phpretard Posted September 26, 2008 Share Posted September 26, 2008 I need some formula that will take this set of radio button and increment them up. The name should start at $i=1; and end at $max=31; $values=1 to 4; The only only real value that needs to change is "value" I know there is an easy script for this I just can't get it put together and I'm embarrassed to show my work thus far. My brain hurts trying to figure this. In theary I believe since the value is simply 1 to 4 I could set a variable (minimum maximum for that). The name is 1 - 32 I could set a variable (minimum maximum for that) The loop Help me... <input type="radio" name='1' value=1> 1 <input type="radio" name='1' value=2> 2 <input type="radio" name='1' value=3> 3 <input type="radio" name='1' value=3> 3 <input type="radio" name='1' value=4> 4 <input type="radio" name='2' value=1> 1 <input type="radio" name='2' value=2> 2 <input type="radio" name='2' value=3> 3 <input type="radio" name='2' value=3> 3 <input type="radio" name='2' value=4> 4 This just repeats up to 32 inside of a table Could someone get me started. I'll be searching until then. Thanks! Quote Link to comment Share on other sites More sharing options...
sasa Posted September 26, 2008 Share Posted September 26, 2008 try for($i = 1; $i < 32; $i++){ for($value = 1; $value < 5;$value++){ echo "<input type="radio" name='$i' value=$value> $value "; } echo "<br />\n"; } Quote Link to comment Share on other sites More sharing options...
phpretard Posted September 26, 2008 Author Share Posted September 26, 2008 How do you do it? Thank you!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.