Jump to content

Form help


tqla

Recommended Posts

There is a form processing script that I am NOT allowed to modify. In this case it puts selected checkbox items into a field called Custom5.

 

The problem here is that it only puts the last checked item from this form element into Custom5.

 

Here is my question. Is there a way to add all of the checkbox selections together and send them as a value for Custom5?

 

 

 

<table width="100%" border="0" cellpadding="0">
  <tr>
    <td>
      <input type="checkbox" name="Custom5" value="Data Analytics"/>Data  Analytics </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5" value="Market Research"/>Market  Research </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5" value="New Branding Campaign"/>New  Branding Campaign </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5" value="Promotions"/>Promotions </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5" value="Interactive/eMarketing"/>Interactive/eMarketing </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5" value="Nothing specific right now"/>Nothing  specific right now </td>
  </tr>
</table>

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/124363-form-help/
Share on other sites

 

I can rename them easily.

 

It's the processing script that I can't modify (it's part of a bigger system).

 

What I need to do is find a way to combine all of the checkbox values into one and then call it Custom5.

 

So I can rename them to cb1, cb2, cb3, and so on and then combine all of the ones that are checked into on hidden field called Custom5.

 

But how???

Link to comment
https://forums.phpfreaks.com/topic/124363-form-help/#findComment-642287
Share on other sites

Change the form to

<input type="hidden" name="Custom5[1]" value="not checked">
<input type="hidden" name="Custom5[2]" value="not checked">
<input type="hidden" name="Custom5[3]" value="not checked">
<input type="hidden" name="Custom5[4]" value="not checked">
<input type="hidden" name="Custom5[5]" value="not checked">
<input type="hidden" name="Custom5[6]" value="not checked">
<table width="100%" border="0" cellpadding="0">
  <tr>
    <td>
      <input type="checkbox" name="Custom5[1]" value="Data Analytics"/>Data  Analytics </td>
  </tr
  <tr>
    <td><input type="checkbox" name="Custom5[2]" value="Market Research"/>Market  Research </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5[3]" value="New Branding Campaign"/>New  Branding Campaign </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5[4]" value="Promotions"/>Promotions </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5[5]" value="Interactive/eMarketing"/>Interactive/eMarketing </td>
  </tr>
  <tr>
    <td><input type="checkbox" name="Custom5[6]" value="Nothing specific right now"/>Nothing  specific right now </td>
  </tr>
</table>

The processing script will see an array called Custom5 with the values.

 

Ken

Link to comment
https://forums.phpfreaks.com/topic/124363-form-help/#findComment-642292
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.