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!
<cfif isdefined('url.id')> <cfset id = #url.id#> <cfquery datasource="db_cie" name = "qGetFacultyCV"> select a.fname, a.lname, b.full_citation, b.pub_date, b.id, b.faculty_id from nrc_faculty a, publications b where a.faculty_id = #id# and a.faculty_id = b.faculty_id order by sort_order, a.lname </cfquery> <!--- <cfoutput> #qGetFacultyCV.faculty_id#</cfoutput> <!------> <cfif '#qGetFacultyCV.full_citation#' NEQ ''> ---> <cfset thisString="#qGetFacultyCV.id#"> <h1> Edit CV For: <cfoutput>#qGetFacultyCV.lname#, #qGetFacultyCV.fname# </h1> </cfoutput> <h3>Select publication to edit:</h3> <cfoutput> <!--- <input name="faculty" type="hidden" value="#id#" />---> </cfoutput> <form action="update-sort.cfm?faculty_id=<cfoutput>#qGetFacultyCV.faculty_id#</cfoutput>" method="post" id="frm-sort"> <ul id="sortable"> <cfloop query="qGetFacultyCV"> <cfoutput> <li "id="section_id_#qGetFacultyCV.id#" class="ui-state-default"><span class="ui-icon ui-icon-arrowthick-2-n-s"></span>#qGetFacultyCV.full_citation#</li> </cfoutput> </cfloop> </ul> <input type="submit" name="delete" value="Delete Publication" /> <input type="submit" name="save" id="save" action="addaction.cfm" value="Save" /> <!--- <input type="hidden" name="sort_serialized" class="sort_serialized" value="" />---> <!---><input type="hidden" name="faculty_id" id="faculty_id" value="<cfoutput>#qGetFacultyCV.faculty_id#</cfoutput>" />---> <!---<cfelse> <h1>This faculty member has no publications on record.</h1> <input type="submit" name="add_pub" value="Add Publication" /> </cfif>---> </cfif> </form> <button id="editbutton">Edit</button> <button id="sortbutton">Sort</button> <button id="addbutton">Add Publication</button> <h3 id="drag" style="display:none">Click and drag to sort.</h3> <h3 id="edit" style="display:none">Click and type to edit.</h3>
And then there is code to insert into database
<cfinsert datasource="db_cie" tablename="#qGetFacultyCV#">
I tried that code without the hash signs and just putting in the table name. None worked. When I click the button all I get is a "Struct Fieldnames: SAVE
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?
Interesting... Thanks for your input (that was a sweet pun eh?). I am a student and new to development, recently started working at my university doing web dev. Thank you for you quick reply. I am going to try this at work on monday and I will get back to you.