Andrew R Posted June 9, 2008 Share Posted June 9, 2008 Hi there, I have following form fields. All the fields contain the same name, activity. How would I post all these fields and then display them/email them? I understand you do something like activity[] put I am not sure how you process them once posted? Any help would be much appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/109431-form-help/ Share on other sites More sharing options...
abdfahim Posted June 9, 2008 Share Posted June 9, 2008 you can name them activity[] an then pass array by POST method... but I prefer to have a hidden input type and then on Form submit, call the following javascript for (i=0; i<document.form.activity.length; i++){ var strtemp=""; strtemp = strtemp + document.form.activity[i].value + "-"; document.form.hiddentype.value=strtemp; } then you will get all activity in the hidden field. You can explode them by "-" to detect them seperately. Link to comment https://forums.phpfreaks.com/topic/109431-form-help/#findComment-561344 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.