Jump to content

Form help


Andrew R

Recommended Posts

Hi there,

 

I have following form fields.

 

25f605j.png

 

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.