that one worked like a charm. Final solution became like this, where the
submit buttons is kind of there just for looks since it will send onkeyUp.
What I really like about it is that It reduces the JQuery to zero for my
part to write which means less code to manage.
-----SOLUTION ---
<form id="update_phone_number" action="#">
Mobile Phone:
<input name="phone"
onkeyup="ajax('{{=URL('update_phone_number')}}', ['phone'], ':eval')" />
<input type="submit"
onClick="ajax('{{=URL('update_phone_number')}}', ['phone'], ':eval')"
value="Add phone number" class="btn btn-success"/>
</form>
On Friday, May 10, 2013 7:26:40 PM UTC+8, Anthony wrote:
>
> http://web2py.com/books/default/chapter/29/11#Eval-target
>
> On Friday, May 10, 2013 6:13:23 AM UTC-4, Mika Sjöman wrote:
>>
>> Hi
>>
>> No I am not calling it from a component, but from a jQuery post when I
>> submit a phone number from a post via ajax.
>>
>> Any ideas?
>>
>> On Friday, May 10, 2013 2:49:33 PM UTC+8, Niphlod wrote:
>>>
>>> if you're using components, use response.js .....
>>> http://web2py.com/books/default/chapter/29/12?search=response.js
>>>
>>> On Friday, May 10, 2013 7:10:31 AM UTC+2, Mika Sjöman wrote:
>>>>
>>>> Hi
>>>>
>>>> I am trying to close a window title dialog with JQUERY after
>>>> sucessuflly updating a clients phone number. The problem is that after I
>>>> successfully update the data I send this as a response to the browser:
>>>>
>>>> ....
>>>> message = "jQuery('#windowTitleDialog').toggle('slow');"
>>>> return message
>>>>
>>>>
>>>> But the script just loads it as text in a DIV instead of executing the
>>>> Jquery :(
>>>>
>>>> The way I call it is like this from the webbrowser:
>>>>
>>>> <script>
>>>> jQuery('#update_phone_number').submit(function() {
>>>> ajax('{{=URL('update_phone_number')}}', ['phone',],
>>>> 'phone_updated_div');
>>>> return false;
>>>> });
>>>> </script>
>>>>
>>>> Anyone has an idea on how to run the JQUERY instead of just loding it
>>>> as text inside the phone_updated_div ?
>>>>
>>>> cheerio
>>>>
>>>
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.