>From what you've tried to explain, I can see that you would really want to
use AJAX, that means, for that page you have to write a JavaScript handler
(function that handles the event of adding a new record by pressing Add or
Enter). The JS will take care of the page not being submitted/refreshed.

Since the page is not being refreshed/submitted, you can use the same JS
method to post or make an AJAX call to the backend, which will be handled by
Django.

On the Django side of the things, you will have proper url to handle this
request in URLS.py and also a view in views.py.

the View method will check for the POST request and depending upon if it is
an AJAX request it will send proper JSON tuple to your page, where again you
will use JavaScript to parse it and append in the already existing table.

I could see this so far.

On Fri, May 13, 2011 at 7:08 AM, GKR <ranagou...@gmail.com> wrote:

> which is the best way to implement the following::
>
> i will be having a text box and a Add  button
>
> Along with a table below it containing headers Serial No, roll no,Name,
> Age, Address, Phone no
>
> my logic is to take the roll no as input from the text box and when i press
> enter either on the text field or click the add button it should search
> through the database
> and add the details to the table without refreshing the whole page. and the
> clear the textfield and focus on it.
>  It will give proper error msg if the roll no is not found
>
> please help how and which is the best way to implement this...
>
> thanks
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
AJ

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to