If you'd like JavaScript to calculate values before you submit the form then do the following:
1. Add a "onSubmit" attribute on your "form" tag which calls a JS function like: <form name="theForm" onSubmit="return doBeforeSubmit()"> 2. In the implementation of that function calculate whatever you need and plant the result into a hidden input field inside your form OR change the value of an existing input field. 3. When you're done, your function should return "true" so that the form submits. Now the form submits with the value you have calculated. Good luck. Yaniv On Feb 15, 6:56 pm, arbi <arbin...@gmail.com> wrote: > Hi all, > > In fact my pb is : I have a <form> that sends a DATA that the user > writes (input), but I would like it to send javascript_function(DATA) > instead. How to do it? > > This is my input. The DATA is a "departure" > <input type="text" name="departure" value="" id="departure"> > > What shoud I write instead of name or value to return the > javascript_function(departure) instead of departure only? (my js > function calculates the latitude in fact). > > In general, how to bring back to view javascript results? > > Thanks a lot! > Arbi --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---