verdrm Posted November 28, 2007 Share Posted November 28, 2007 Can you tell me how using JavaScript or PHP to duplicate text fields based on a pull down menu? For instance, if I choose '3' on a pull-down list and hit 'Update', the page will refresh with three text fields. Link to comment https://forums.phpfreaks.com/topic/79173-solved-multiple-text-fields/ Share on other sites More sharing options...
cooldude832 Posted November 28, 2007 Share Posted November 28, 2007 js can do this, php can just be really easy <?php if(is_numeric($_GET['field_count'])){ for($i = 0; $i <$_GET['field_count']; $i++){ echo "<input type=\"text\" name=\"text[".$i."]\" value=\"\" />"; } } else{ echo "<input type="\text\" name=\"text[0]\" value=\"\" />"; ?> Link to comment https://forums.phpfreaks.com/topic/79173-solved-multiple-text-fields/#findComment-400756 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.