well I will explain better what my application do:it buys rechage,this is
the principal functionality...beyond this,it posts an activity with the
fields submitted by the user...the activity part works well,but it doesn't
buy recharge...the jquery code calls some php/django code that makes the
application work,that buy recharge...i will post some of this code,maybe you
can help me:

            $('#submit').click(function() {
                alert('asdf');
                if ( valid() ) {
                    alert('11111');
                    callModal();
                    query = 'action=process' +
                    '&ntc=' + remove_mask($('#id_phone1').val()) +
                    '&confirm_ntc=' + remove_mask($('#id_phone2').val()) +
                    '&value_product=' + $('#id_product_value').val() +
                    '&username=' + $('#id_username').val() +
                    '&password=' + $('#id_password').val() +
                    '&type_file=xml' +
                    '&cod_product=' + $('#id_product').val();
                    $.ajax({
                        type: 'POST',
                        url: '{% url call_recharge %}',
                        //url: '{% url auth_recharge %}',
                        data: query,
                        success: function(ret) {
                            closeModal();
                            $('#cont').html(ret);
                        }
                    });
                } else {
                    closeModal();
                }
            });
            function remove_mask(value) {
                if (value.indexOf('-') == -1) {
                    return value;
                } else {
                    value = value.replace(/[-]/, "");
                    value = value.replace(/[.]/, "");
                    value = value.replace(/[(]/, "");
                    value = value.replace(/[)]/, "");
                    return value;
                }
            }
            function valid() {
                var status = true;
                status = status && field_valid('id_phone1');
                status = status && field_valid('id_phone2');
                status = status && field_valid('id_mobile_carrier');
                status = status && field_valid('id_product_value');
                status = status && field_valid('id_username');
                status = status && field_valid('id_password');
                status = status && field_valid('id_product');
                return status;
            }
                        function field_valid(field) {
                $('#div_' + field).removeClass('error');
                $('#error_1_' + field).remove();
                if ( $('#' + field).val() == '' ||  $('#' + field).val() ==
0) {
                    $('#div_' + field).addClass('error');
                    $('label[for=' + field + ']').before("<p id='error_1_" +
field + "' class='errorField'>{% trans 'This field is required.' %}</p>");
                    return false;
                } else {
                    return true;
                }
            }
        });

2010/5/28 André Lima <azdr3mi...@gmail.com>

> There is some django code on this jQuery code...so it's impossible to
> put it on the opensocial gadget...I have to call it
> somewhere,somehow...I tried to read jquery-opensocial,but it's in
> japanese...if anyone can help me with this...anyway,I already
> thankful!
>
> On 27 maio, 20:06, André Luís Moura Lima <azdr3mi...@gmail.com> wrote:
> > Hello everybody,
> > I'm trying to add some jQuery code in my opensocial gadget,but it always
> > fails...I'm trying to do it using the jquery-opensocial plugin,but
> firebug
> > don't recognize my calls to jquery files...I'm trying something like
> this:
> > <script src="js/jquery.js" type="text/javascript"></script>
> > <script src="js/jquery.maskedinput-1.2.2.min.js" type="text/javascript">
> > </script>
> > <script src="js/jquery.simplemodal-1.3.5.min.js" type="text/javascript">
> > </script>
> > <script src="js/opensocial-jquery.js" type="text/javascript">
> > </script>
> > <script src="js/opensocial-jquery.min.js" type="text/javascript">
> > </script>
> > but firebug always shows me the same error:
> > $ is not defined
> > $(function() {
> > I know that this error is shown when the paths of the files aren't
> right,but
> > in this case they are(though it's not complete here)...The jquery code is
> > originally in another file,a html...there is any way to get it instead of
> to
> > add the jquery code in the opensocial gadget?For now I'm trying to add
> the
> > jquery code,but if there is any other way,I will try it.
> > Thanks in advance.
>
> --
> You received this message because you are subscribed to the Google Groups
> "orkut Developer Forum" group.
> To post to this group, send email to opensocial-or...@googlegroups.com.
> To unsubscribe from this group, send email to
> opensocial-orkut+unsubscr...@googlegroups.com<opensocial-orkut%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/opensocial-orkut?hl=en.
>
>

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

Reply via email to