Skip navigation
Currently Being Moderated

button and struct[empty]

Dec 20, 2013 10:12 AM

Tags: #forms #buttons #coldfusion

I have a form with Javascript, two buttons "EDIT" and "SORT". There is Jquery-UI code for click and dragging list items that are pulled into the form from a database. When you click button "EDIT", it adds the HTML5 attribute "contenteditable" and adds a class "unsortable" which disable the sort function and allows you to edit in place. When you click "Sort" it removes the "contenteditable" attribute and "unsortable" class and lets you sort again.


Problem - If the buttons are outside of the form then it works fine. If the buttons are inside of the form I get an error struct[empty].  Why?  I don't need buttons that pass values, I just need them to trigger the javascript.   Also, it is not a cfform, just a regular html form.


There is a 3rd button, SAVE that when clicked will save the edited changes and order to the database. ...I haven't got that far yet.


This is the only way I can figure to do an edit in place on this page... any ideas/help would be great!




  • Currently Being Moderated
    Dec 20, 2013 10:46 AM   in reply to gwarmonger

    Can you post the portion of the HTML code that contains the form and buttons?  It would help very much.

    -Carl V.

    Mark as:
  • Currently Being Moderated
    Dec 20, 2013 11:52 AM   in reply to gwarmonger

    If you want the buttons inside the form, have you tried changing them to inputs instead: <input id="editbutton" type="button" value="Edit">, or at least adding the type="button" attribute to the existing <button> tags?


    Depending on the browser, the <button> element may default to type="submit" (which submits the form) rather than type="button" (which doesn't do anything unless you intercept the click event in JavaScript).


    -Carl V.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points