Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.