Hi
i have a view with a table of users. with each row there are three links to view details, update and delete. each open a jquery ui dialog and when it is pressed the user is deleted by ajax call and so on.
i have a link to add a user. which open a dialog too with a form.
after the form is filled and the add button pressed it is added to the database via ajax.
all works but 2 things:
1- if i get success call i prepend a row to the user table to display the added user. it works but the three links (view update delete) does not open a dialog when they are pressed. instead i am redirected to the corospondant page as if javascript is disabled. after i refresh the page that same record does open the dialogs.
what am i missing here?
2- i have client side validation and a server side validation. but i cannot display the server side validation .
i attach my ajax call and the php code for the server validation.
Ok, thanks I just want to be sure to see the line 3 : e.preventDefault();
Try to use live and a class instead the same ID for all your element (because ID must be unique) :
$("a.userdelete").live
instead :
$("a#userdelete").click
you did not post the part open the dialogs (view, update, delete)
0
An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
i have my validation check and then i use if else: if all required fields are filled and they are acceptable the i insertit into the database but if some required fields are empty or if they are filled incorrectly i echo the missing fields and errors.
the thing is that in firebug (when i delibratly leave some fields empty and some errors) i do get the the right response but when i try to alert them it does not work.
the bizzare thing is that when there are no errors or missing required fields i can use the returned data.
so i am confused. i am not that great with ajax yet.
in the code i published in the original you can see that i use the returned data to generate the tr of the table.
>>but i cannot display the server side validation .
It would best if you post that as a new question in the PHP code AND provide code + some description as what exactly is the problem. Simply saying " but i cannot display the server side validation ." is a "useful" as saying "My program doesn't work. Please help me". The more descriptive you are, the faster others will be able to help you.
Ok, thanks I just want to be sure to see the line 3 : e.preventDefault();
Try to use live and a class instead the same ID for all your element (because ID must be unique) :
$("a.userdelete").live
instead :
$("a#userdelete").click