0

I want to send some parameter to Django with post action when I click on link in web page call JavaScript or JQuery function then call URL and post some parameter in this function without AJXA type in other words when click in navigation bar in web page call URL and send some parameter to function in view in Django how can I do this?

Thanks for help.

HDJEMAI
  • 9,436
  • 46
  • 67
  • 93
Erfan
  • 485
  • 2
  • 6
  • 13
  • Why don't you want to use ajax? what have you tried/researched? – Sayse May 23 '17 at 07:23
  • Because i want redirect to another page with that parameter – Erfan May 23 '17 at 07:26
  • for example when i click on profile tag in navigation bar call one function in backend and send name and id of this user to this function with post action and this function redirect to another URL and call appropriate function – Erfan May 23 '17 at 07:31
  • Are you sure you need to use post method? – Windsooon May 23 '17 at 07:55
  • POST needs a form and an input of type 'submit'. turn your link to an give your form the action attribute and you are good to go... – Mani Shirvani May 23 '17 at 08:29
  • with jquery can post some parameter and call Url but this type is ajax than page dont reload and i cant call another page – Erfan May 23 '17 at 14:33
  • You can also redirect using jquery and ajax. What have you tried so far? Is the only issue with using ajax that you want to redirect to another page after the call? – wahwahwah May 26 '17 at 21:35

1 Answers1

0

It sounds from your example above that it may be worth looking into url patterns to link to a profile page view in which the user ID is a captured argument?

Django Docs - URL dispatcher

Tom
  • 141
  • 1
  • 4
  • you sad true but i want to design with mongodb and i try to dont use id in url pattern and work with post user email and page name requirement in client – Erfan May 23 '17 at 14:31
  • i have one function in Django view to give email of user and name of page requirement than redirect to other Url for make that page this function get email and page name with post action but request is ajax type in web page and dont reload page – Erfan May 23 '17 at 14:37