Jquery function not passing form data

Hi there everyone!

I’ve utilized a jquery tag editing widgit called Tag-It on one of my forms to allow me to add things like part numbers, keywords, etc. The issue that I’ve run into is that the first time I implemented it works fine(the MPN or part number input) but my attempt to use it a second time is resulting in no data from the input being passed to POST. I’ve exhausted my troubleshooting methods and have begun to suspect that the issue might be arising from trying to reuse the function without making a change of some sort.

Here’s the form in action. Submitting will print the post array so you can see what I mean: https://wheeltastic.com/test.php

The necessary js file has already been called,

[code]

[/code]

I created a new function for the keyword input

[code]

[/code]

and made sure to rename the necessary UL for it’s second use:

[code]

  • 45-8010
  • 45-8010
    [/code]

    If anyone could point out what I’m doing wrong, I’d greatly appreciate it. Thanks for your time!

    Hey schwim, the keyword list (and everything in the right-hand column, in fact) is outside of the form tags, so they won’t be included when you submit.

    Hi there FB and thanks for your help!

    The editor placed after the keyword and the CIW/CIC inputs right above keyword are getting posted and the only /form shows up well after the keyword element. How are the CIC and editor showing up but not the keyword element?

    EDIT: Perhaps you’re saying that because of the additional submit button at the top of that column? I placed that there because I often had to make changes just to the wholesaler/competitor inputs and it allowed me to submit the form without scrolling all the way to the bottom.

    [code] Keywords:





      		<td class="border">
      			<img width="150" alt="" src="/images/cartitems/45-8010-1.jpg"><br>
      			<input type="checkbox" name="image-1916"> Delete Image<br>
      			<input type="radio" name="isprimary" value="1916" checked> <b>Make Primary</b><br>
      		</td>
      		
      		<td class="border" style="height: 200px; text-align:center; vertical-align:middle">
      			<a title="Upload an image" onclick="javascript:window.open('/ixO7AjM6kN1214QKiW2v/?do=ci-imgup&id=824','PUImgUp','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700'); return false;" class="about_paypal" href="/ixO7AjM6kN1214QKiW2v/?do=ci-imgup&id=824"><img alt="" src="/theme/1/images/plus.png"></a>
      		</td>
      		
      			</tr>
      		</table>
      	</td>
      </tr>
      <tr>
      	<td colspan="3">
      	<br>
      	<br>
      	<textarea name="description" id="description" rows="20" cols="40"><p>The OnX6 Rock Guard is designed for daytime use, not only to protect from dust and dirt, but to protect from harsh terrain that may throw pesky rocks at your OnX6 LED light bar. If you are looking for extra protection from your riding environments and a cool cover, then the OnX6 Rock Guard is your answer!</p>
      


      [/code]

      Just to make sure, I added this above the keyword UL:

      <input type="hidden" name="keyword[]" value="here!">

      and it’s showing up in POST data so it’s not a location in the code that is causing the issue.

      If you inspect the page with the dev tools, the closing form tag is here:

      <table style="width:100%">
        <tbody>
          <tr>
            <td style="width:30"></td>
            <td style="vertical-align:top">
              <br>
              <form method="POST" name="ci_add" action="/test.php">
                ...
              </form>
            </td>
      

      I suspect the browser is changing the location of the closing tag to correct for invalid markup.

      If you run the test page through a validator (https://validator.w3.org/nu/?doc=https%3A%2F%2Fwheeltastic.com%2Ftest.php), these are the last two errors:

      If you move the form’s tags so that it wraps the first table row, that should be OK:

      <table style="width:100%">
        <tbody>
          <form method="POST" name="ci_add" action="/test.php">
            <tr>
              ...
            </tr>
          </form>
          <tr>
            ...
      

      That way, you won’t have any overlapping tags, and the HTML should be valid.

      nope, only <tr> may be child elements of <tbody>.

      Fair play. In which case the form will have to be moved outside the table.

      That’s what I ended up doing and it works great. My ignorance about this matter cost me hours of troubleshooting so hopefully I’ll remember this hard-earned lesson.

      Thanks for your help!

      This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.