| | #1 |
| Active Warrior Join Date: 2010 Location: Malaysia
Posts: 36
Thanks: 14
Thanked 0 Times in 0 Posts
|
please i need help on how to assign new names for html input element at run time, i have not tried it but i know it will not work please any idea? <?php $x=1; while( $x < 5) { echo "NOW YOU WILL UNDERSTAND WHAT I MEAN"; echo "<br/>"; echo '<input type = "checkbox" name = <?php $x ?>/>'.$x; echo "<br/>"; echo '<input type = "checkbox" name = <?php $x ?>/>'.$x; echo "<br/>"; echo '<input type = "checkbox" name = <?php $x ?>/>'.$x; echo "<br/>"; $x++; } ?> |
| |
| | #2 |
| Active Warrior War Room Member Join Date: 2012
Posts: 46
Thanks: 9
Thanked 17 Times in 15 Posts
|
Do you only need to assign it as the page is initialized or does it need to change from user input ? As it looks now it's just needed for the initialization and then what you've done should work, except why do you use the end and start tags <?php ?> in the middle of the script? You haven't stopped using php just because you are echoing html code. This is probably what you'd want. echo '<input type = "checkbox" name = "'.$x.'">'.$x; |
| |
| The Following User Says Thank You to Delta90 For This Useful Post: |
|
| Bookmarks |
| Tags |
| assign, element, html, input, names, run, time |
| |