Website has a "How did you find us?" section when filling out billing data. Right now there is some javascript that makes the radio buttons act as checkboxes. What ever area is checked adds the value to the database. So if the "Facebook" checkbox is checked then the value "Facebook" gets added to the data base.
I need the "Other" input type to be a "text" input field rather than a "checkbox" field, so the customer can specify where they found us. I am able to get a text input field working, but then then the checkboxes above don't work anymore.
Here is the HTML for the radio buttons as checkboxes:
<tr>
<td align="right" nowrap="" style="padding-top:4px;"><span class="ff_fontname" style="padding-right:10px;">How did you find us?</span></td>
<td nowrap="" style="padding-top:4px;">
<input type="checkbox" class="custcheck" name="address_referrer" id="fbook" value="Facebook" onclick="referrerCheck(this);" />
<label for="fbook" class="custlabel"><span class="ff_fontname">Facebook</span></label></td>
</tr>
<tr>
<td align="right" valign="middle" nowrap="" style="padding-right:10px;"></td>
<td nowrap="" style="padding-top:12px;">
<input type="checkbox" class="custcheck" name="address_referrer" id="pinter" value="Pinterest" onclick="referrerCheck(this);" />
<label for="pinter" class="custlabel"><span class="ff_fontname">Pinterest</span></label></td>
</tr>
<tr>
<td align="right" valign="middle" nowrap="" style="padding-right:10px;"></td>
<td nowrap="" style="padding-top:12px;">
<input type="checkbox" class="custcheck" name="address_referrer" id="friend" value="Friend" onclick="referrerCheck(this);" />
<label for="friend" class="custlabel"><span class="ff_fontname">Friend</span></label></td>
</tr>
<tr>
<td align="right" valign="middle" nowrap="" style="padding-right:10px;"></td>
<td nowrap="" style="padding-top:12px;">
<input type="checkbox" class="custcheck" name="address_referrer" id="other" value="Other" onclick="referrerCheck(this);" />
<label for="other" class="custlabel"><span class="ff_fontname">Other</span></label></td>
</tr>
I need the bottom "Other" checkbox to be a text input and have tried the code below, but it causes the checkboxes to not function anymore:
<tr>
<td align="right" valign="middle" nowrap="" style="padding-right:10px;"></td>
<td nowrap="" style="padding-top:12px;">
<input type="text" class="input-text" name="address_referrer" id="other" value="" placeholder="Other.." />
<label for="other" class="custlabel"></label></td>
</tr>
What am I doing wrong? Can the text field act as a checkbox so it doesn't screw up the javascript?
Aucun commentaire:
Enregistrer un commentaire