ahmedsa
September 18, 2016, 9:25pm
1
Problem
when remove any course from table list html his position in center or first it make problem
in index in database
Details
IF I have list of courses as following :
Delphi
Flash
Photoshop
IF I remove flash by JQUERY remove button then click save button
it delete flash and Photoshop
because there are wrong in delete courses by using remove function in jquery
if i remove php it is working without any problem because it is last item
suggestion
using map function when remove but how to do that
if there are any solution for that without using map no problem
I post fiddle here
i post the fiddle here
to see image what i need below
see image below to understand what i need
It’s the index value that you’re putting in the empcourses[]
array that’s messing you up.
Remove that index value and the server-side can then access them.
ahmedsa
September 19, 2016, 12:36pm
3
can you show me how i remove
Sure, there are two places in the code where you append html content with rhe index. Just remove the index part of that code.
ahmedsa
September 19, 2016, 2:17pm
5
i modify my code as you tell me in the following lines
$("#tb").append("<tr><td><input type = 'hidden' name='empcourses.CourseId' value='" + e.Id + "'/></td><td>" + e.CourseName + "</td><td><input type='button' value='remove' class='r'</td></tr>")
are that what you mean
ahmedsa
September 19, 2016, 4:20pm
6
are this value above is true
how to manage index
ahmedsa:
are that what you mean
Don,t remove the square brackets from the end of the name attribute, for that allows PHP to receive the information as an array.
ahmedsa
September 19, 2016, 8:10pm
8
OK but how server side know that item hide
to know what i mean see link below
system
Closed
December 20, 2016, 3:10am
9
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.