[jQuery] Re: ajaxForm and validate plugin

2009-08-04 Thread András Csányi

Hi David!

Thanks the solution, I will try it!

András

2009/7/21 David Parloir david.parl...@gmail.com:

 hi András,
 I suppose that after 2 weeks you found a solution, but i was in the
 same situation and I was thinking too bad there is no answer to that :
 (
 So, now that I've found the solution, here it goes, for the next one.

 1. i create the form's validation rules:
    $('#formId').validate({
        rules: {
            field1Id: {
                required: function() {
                    return $(#anotherFieldId).val() == 'the value I
 want';
                }
            }
        }
    });

 2. i create a checkForm function:
    function checkForm () {
        if (!$('#formId').valid()) {
            alert(Something is wrong in the form. Please check the
 messages)
            return false;
        } else {
            return true;
        }
    }

 3. Finally, I add a beforeSubmit (which trigger the checkForm
 function) at the ajaxForm:
    $('#formId').ajaxForm( {
        beforeSubmit: checkForm
    } );

 this is it :)
 my sources: http://www.malsup.com/jquery/form/#code-samples and
 http://www.chrillo.info/2008/10/14/jquery-ajaxform-and-validate-with-ajaxsubmit/
 cheers


 On Jul 5, 11:20 am, András Csányi sayusi.a...@gmail.com wrote:
 Hi all!

 I have a form and I want to validate before submit with [1] plugin
 because nice and good. I want to send the form's data with ajaxForm
 [2] plugin.
 The problem is the next:
 I set the ajaxForm options that before send the data validate. The
 validate plugin is working fine because I got error message(s) but the
 empty form was sended always.

 I want that while the form is not correct the ajaxForm don't send the data.

 Does know anybody example for this with these two plugins?

 Plugins:
 [1] -http://bassistance.de/jquery-plugins/jquery-plugin-validation/
 [2] -http://malsup.com/jquery/form/#getting-started

 Here is my simple code:

 html
   head
     titleasd/title
     script src=jquery.js/script
     script src=jquery.validate.js/script
     script src=jquery.form.js/script
     script
       $(document).ready(function() {
         function formValidate() {
           $(#formid).validate({
             rules:{
               asdasd: required,
               bsdbsd: required
             },
             messages:{
               asdasd: Ide kellene valamit írni!,
               bsdbsd: Ide se ártana balyétom!
             }
           });
         }
         var ajaxFormOptions = {
           beforeSubmit: formValidate()
         }
         $(#formid).submit(function(){
           $(this).ajaxSubmit(ajaxFormOptions);
           return false;
         });
       });
     /script
   /head
   body
     form id=formid action=post.php method=post
 enctype=multipart/form-data
       p
         asdasd input id=asdasd name=asdasd type=text
       /p
       p
         bsdbsd input id=bsdbsd name=bsdbsd type=text
       /p
       p
         input type=submit value=submit
       /p
     /form
   /body
 /html

 I would like appreciate your kind help!

 --
 - -
 --  Csanyi Andras  --http://sayusi.hu-- Sayusi Ando
 --  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell




-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Looking for a Good JavaScript Editor that Supports JQuery

2009-08-03 Thread András Csányi

2009/8/2 S2 smnthsm...@gmail.com:

 Does anyone know of a good JavaScript editor that supports JQuery?
 Anyone sucessfully integrate JQuery into Eclipse/WTP or JSEclipse?

Hi,

I'm using Netbeans and I like it very much. But telling the truth my
golal is generate jquery source code by php. So, I'm using less time
than a normal developers.



-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: function running 2X

2009-07-29 Thread András Csányi

2009/7/29 marksimon zen...@gmail.com:

 Any idea why this would run twice:
 function clickcharges() {
        $('#cardcharges tr td').click(function() {
        alert('execute once');

         });
 }

Stupid idea, but maybe... Because the td tag is part of the tr. And if
you click the cell once means that one click on the cell and one click
on the row... :)

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: get value of textfield

2009-07-29 Thread András Csányi

2009/7/29 shaf shaolinfin...@gmail.com:

 Hi Guys

 How do I get the value of a form textfield ?

 form
   input type=text name=name id=name / Your Name
 /form

Hi!

Try it like this:
$(#name).val();

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] order of ajax calls

2009-07-21 Thread András Csányi

Hi All!

I have this script:
$(document).ready(
  function(){
$('#movies_menu').click(
  function(variable_main){

$.getJSON(\\/movies\,function(moviesLibraryvar_800925333){$('#grid').html(moviesLibraryvar_800925333)});

$.getJSON(\\/moviesbuttons\,function(moviesButtonsvar_2070324278){$('#buttons').html(moviesButtonsvar_2070324278)});
  
}).mouseout(function(){$('#movies_menu').removeClass(\actionTitleMouseOver\);}).mouseover(function(){$('#movies_menu').addClass(\actionTitleMouseOver\);})});


This script generated by php, but not not this is the point. I noticed
that the 2 getJSON method are started the same time, I can say these
calls are asynchronous calls. The problem is that in few case the
second and/or the third calls are depends on the calls which takes
place before because these or that call(s) set(s) up few things for
example php session.
The question: how can do that a call start that when the other call is finished?

I would like appreciate your kind help!

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: order of ajax calls

2009-07-21 Thread András Csányi

2009/7/21 MorningZ morni...@gmail.com:

 Yeah, your first mistake is assuming that the first will be done when
 the second is called

 you've got two choices, one with a plugin, one without

 1) with plugin...  google jQuery Ajax Queue.. it's an older plugin,
 but people have said in here that it still works fine

 2) put the 2nd getJSON call inside the success event of the first...
 so like

Okay. You are right and the options what you mentioned likes form me,
but I asked hungarian web developers and they sad I have a third
option:
using ajaxSetup llike this:
$.ajaxSetup({
  async: false
});
The problem what I see in this case that ajaxSetup working globally
and after async calls I have to set back to sync.

So, thanks for your help and now I have options. And I like this situation. :)

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Form with Ajax Load Content combined with onClick

2009-07-12 Thread András Csányi

2009/7/12 Erik eriks...@mac.com:

 Is it possible to combine the following?


 form action=https://www.expressdb.com/edp/?
 AppKey=3905B91021BD0A1490189D249874B317AAD9067B method=post
 enctype=multipart/form-data

I suggest you, try it! :)

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Form with Ajax Load Content combined with onClick

2009-07-12 Thread András Csányi

2009/7/12 Erik eriks...@mac.com:

 I already did and no luck :-(

 Any suggestions?

there is another two way:
- change the method to get
- use hidden fields to send special data

These are good for you?

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Form with Ajax Load Content combined with onClick

2009-07-12 Thread András Csányi

2009/7/12 Erik eriks...@mac.com:

 A little more detail and example would be great.

First:
But, I'm not sure this is working fine.

form action=https://www.expressdb.com/edp/?
AppKey=3905B91021BD0A1490189D249874B317AAD9067B method=GET
enctype=multipart/form-data

Secondly:
form action=https://www.expressdb.com/edp/; method=post
enctype=multipart/form-data
input type=hidden name=AppKey
value=3905B91021BD0A1490189D249874B317AAD9067B
/form

I hope it helps you.
-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] ajaxForm and validate plugin

2009-07-05 Thread András Csányi

Hi all!

I have a form and I want to validate before submit with [1] plugin
because nice and good. I want to send the form's data with ajaxForm
[2] plugin.
The problem is the next:
I set the ajaxForm options that before send the data validate. The
validate plugin is working fine because I got error message(s) but the
empty form was sended always.

I want that while the form is not correct the ajaxForm don't send the data.

Does know anybody example for this with these two plugins?

Plugins:
[1] - http://bassistance.de/jquery-plugins/jquery-plugin-validation/
[2] - http://malsup.com/jquery/form/#getting-started

Here is my simple code:

html
  head
titleasd/title
script src=jquery.js/script
script src=jquery.validate.js/script
script src=jquery.form.js/script
script
  $(document).ready(function() {
function formValidate() {
  $(#formid).validate({
rules:{
  asdasd: required,
  bsdbsd: required
},
messages:{
  asdasd: Ide kellene valamit írni!,
  bsdbsd: Ide se ártana balyétom!
}
  });
}
var ajaxFormOptions = {
  beforeSubmit: formValidate()
}
$(#formid).submit(function(){
  $(this).ajaxSubmit(ajaxFormOptions);
  return false;
});
  });
/script
  /head
  body
form id=formid action=post.php method=post
enctype=multipart/form-data
  p
asdasd input id=asdasd name=asdasd type=text
  /p
  p
bsdbsd input id=bsdbsd name=bsdbsd type=text
  /p
  p
input type=submit value=submit
  /p
/form
  /body
/html

I would like appreciate your kind help!

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: form submit during getJSON

2009-04-30 Thread András Csányi

2009/4/30 Ben bhoipkem...@gmail.com:

 I am having trouble submitting a form by clicking on a button input
 type='submit' / while I am waiting for the callback of the $.getJSON
 function to fire.

 Is there a way to allow the form to submit even if the callback is
 never called?

Have you tried this?
http://malsup.com/jquery/form/

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: form submit during getJSON

2009-04-30 Thread András Csányi

2009/4/30 donb falconwatc...@comcast.net:

 Whoa!  That link sents me to a 'spyware-files.info' website!!!

Which link? What I'm suggested or my blogs link? Both working for me.

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: How to get JQuery to parse text as HTML

2009-04-21 Thread András Csányi

2009/4/21 default_user ayapej...@gmail.com:

 I'm trying to get jquery to parse some text in a variable as HTML, has
 anyone tried this before and got it to work?  Can this even be done,
 or do I have to parse as text?

 CODE

 testHTML = htmlhead/headbodyulli class='targetMe'TESTING/
 li/ul/body/html;

 testGetHTML = $(.targetMe, testHTML).html();

 alert( testGetHTML );

 /CODE

Maybe I'm wrong, but the testHTML variable place is in the html
function, isn't? For example:
testGetHTML = $(.targetMe).html(testHTML);
Or I missunderstood what is your problem... :)

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: I need some hints

2009-04-18 Thread András Csányi

2009/4/17 András Csányi sayusi.a...@gmail.com:
 Hi all!

 I'm developing an php and jQuery based grid (something like this:
 http://www.phpgrid.com/grid/) for my Thesises and I want to coloring
 the table row if the mouse over the row. You know, this is the minimal
 visual feature what is following the users eyes...
 I tried with css (tr class=css_class with :hover) and jQuery
 (every tr tag has id and .addClasses and .removeClasses) but I
 could'nt. I'm not an css and jquery magician. :$

 So, I need some hints how can I do this with jquery. Or you can give
 some tutorial or examples.

 Appreciate yours help!

 András

Hi all!

This is lot of help! Thank you! The solution easy very much :)
I did it with css.

Thank you again!

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] I need some hints

2009-04-17 Thread András Csányi

Hi all!

I'm developing an php and jQuery based grid (something like this:
http://www.phpgrid.com/grid/) for my Thesises and I want to coloring
the table row if the mouse over the row. You know, this is the minimal
visual feature what is following the users eyes...
I tried with css (tr class=css_class with :hover) and jQuery
(every tr tag has id and .addClasses and .removeClasses) but I
could'nt. I'm not an css and jquery magician. :$

So, I need some hints how can I do this with jquery. Or you can give
some tutorial or examples.

Appreciate yours help!

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi

2009/4/15 Snef sne...@gmail.com:

 When using $.ajax() i encounter some problems.

 With the ajax I'm calling a script that will return some html. When
 echoing the returned data, I can see that everything is returned
 including the javascript tags.

 When 'inserting' the returned data into a div on the screen, the
 javascript seems to be executed but i can't see it in the generated
 source!

 I cut it all down to some simple insertion of html into a div like
 this:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascriptalert(Bla);/
 scriptpBla bla/p');

 The html is inserted in #freediv but i can't see the script tags
 (although alert(Bla) did get executed).

 The real problem is when i try to use some jQuery in the html:

 $(#freediv).html('h1 id=testtest/h1script
 language=javascript type=text/javascript$(#test).click(function
 (){ alert(Bla});/scriptpBla bla/p');

 Isn't this possible at all?

 I'm using this to create some 'popup' forms (maybe with SimpleModal)
 and I want to include some javascript into the response that is
 specific for that form (like validation and other actions). I know i
 can use liveQuery or even jQuery's live() but then i need to have all
 the javascript for every used form already in the main document.

 I hope you understand my problem ;)

I understand because my application works fine and use this way (I
hope this is the right expression at this case :$)
So, in my application the html code with jquery source looks like this
(I refactored your code upper):

$(#freediv).html('h1 id=testtest/h1script
language=javascript type=text/javascript
-- this line! $(document).ready(function() {
$(#test).click(function
(){ alert(Bla});
-- this line! })
/scriptpBla bla/p');

Note that I'm using every case the $(document).ready(function(){--my
code--}) part.
Not so beaty but works! :D
I suggest you try it this way.

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi

2009/4/15 Snef sne...@gmail.com:

 I already tried it with the $(document).ready(function(){.}). No
 success. :(

And through $.getJSON()?
At night I can send you an string what is go through json into $(#foo).html();

András

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: Handling html with javascript in .html()

2009-04-15 Thread András Csányi

2009/4/15 Snef sne...@gmail.com:

 Well a tip to all. When having problems, first give your pc a nice
 reboot ;)

Are you serious? :)
Which OS do you have?

 Suddenly it is working :S Don;t know why, but it is.

O_o

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] more than 1 $.getJSON in click event

2009-04-02 Thread András Csányi

Hi all!

I want to do the next: I have one string on the website. The user
click to the string and the click action is run more than 1 $.getJSON
call.
Sometimes is needed every call output write on the website. But if I
put more than 1 $.getJSON call in one click events function (see the
example) I can write the first $.getJSON call output to the website,
but the second $.getJSON output I can't write.

I think the code is good because I changed the parameters and always
the first output is okay.
So I'm courious what a hell is the problem. I'm not an big javascript
and jquery magician... :)

Thanks for the help and sorry because of my english ;)

So, here is the source code:

$(document).ready(
  function() {
$(#test).click(
  function() {
$.getJSON(index/test,
  function(var_982505985){
$(#target2).html(var_982505985);});
$.getJSON(index/test2,
  function(var_1366133349){
$(#target3).html(var_1366133349);});
  }
)
  }
);

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: more than 1 $.getJSON in click event

2009-04-02 Thread András Csányi

2009/4/2 James james.gp@gmail.com:

Hi James!

 The code looks fine. Have you tried using the Firebug plug-in for
 Firefox to debug the AJAX calls? It can help you see whether the call
 was made, the request data sent, the response data, errors, etc.

I'm using Firebug. The call is working fine. I can see the result
(some string). No errors. Nothing only the string what I want to print
it.

-- 
- -
--  Csanyi Andras  -- http://sayusi.hu -- Sayusi Ando
--  Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: unknow wrror

2008-08-20 Thread András Csányi
2008/8/20 Csányi András [EMAIL PROTECTED]:


 Hi all!

 I try to make an application with ajax.
 I need a input field with typewatch plugin. If the user stop the type
 the TypeWatch call an php function through $.getJSON().

 The ajax call workig fine. The result come back. I can see in Firebug
 but i have an error message (bottom). What is the error? Did I
 something wrong?

yes, i did something wrong. It was an syntax error. now working fine.

-- 
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: getJSON - how do you make it work?

2008-08-18 Thread András Csányi
2008/8/18 Jon Sidnell [EMAIL PROTECTED]:

 Hi

 I'm trying to get some JSON content using the $.getJSON function, but
 it just won't work!!

 I started out using ASP.NET to generate a load of JSON, but decided to
 create a simple text file with a JSON string in it instead.

I did generate jQuery source code with php. I think this is - generate
js code with other language, the deepest hell of the programming's
world.
Last week i tryed again but the firebug sad the code is perfect - no
error, but the code wasn't run. I did copy the generated source and I
did paste the firebug running window and I did press run and the
code did run fine. I did find 2 hours long what the error is. I gave
up. I dont know...

Sorry my english.

András

-- 
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: validate with form plugin

2008-05-12 Thread András Csányi
2008/5/11 Jörn Zaefferer [EMAIL PROTECTED]:

  What exactly are you trying to achieve? Currently the only thing I can
  provide is a pointer at the example you already found...

  Jörn

So,
i put here my code, and i hope you can tell me what i did wrong.

form:

form id=probaform method=post action=action.php
legendTeszt form/legend
a:input type=text name=nev id=nevbr
b:input type=text name=utonev id=utonevbr
c:input type=text name=email id=emailbr
input type=submit id=submit
/form

  $('#probaform').validate({
rules:{
  nev:required,
  utonev:required,
email:{
  required: true,
  minLegth:3,
  }
},
messages:{
  nev:Adjad meg a nevedet!,
  utonev:Adjad meg a keresztnevedet!,
  email:{
required:Adjad meg az email cimedet!,
minLength:normálisat bazdmeg...,
},
  },
submitHandler: function(form) {
$(form).ajaxSubmit({
target:'#visszajelzes',
url: 'action.php',
type: 'POST',
dataType: 'null',
  });
}
  });

This code make fantastic validation event for me, its okay. But if a
post the code, the page is reload. And there is the problem. I wont
reload the page.

If I comment few lines (down) the code is working fine (posting the
datas and not reload the page). But the validation events is missing.

So I think I'm totally confused what I have to and what I haven't to
do for a normally form.
Normally form is the next: validate the input fields and posting the
datas without page reload.

  $('#probaform').validate({
// rules:{
//   nev:required,
//   utonev:required,
// email:{
//   required: true,
//   minLegth:3,
//   }
// },
// messages:{
//   nev:Adjad meg a nevedet!,
//   utonev:Adjad meg a keresztnevedet!,
//   email:{
// required:Adjad meg az email cimedet!,
// minLength:normálisat bazdmeg...,
// },
//   },
submitHandler: function(form) {
$(form).ajaxSubmit({
target:'#visszajelzes',
url: 'action.php',
type: 'POST',
dataType: 'null',
  });
}
  });

So thanks for the help and patience again :)

And sorry my english, a little bit hunglish...

András

-- 
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] Re: validate with form plugin

2008-05-12 Thread András Csányi
2008/5/12 Jörn Zaefferer [EMAIL PROTECTED]:

  This line is broken: minLegth:3,. The method is minlength and
  you've got a trailing comma which screws up any non-firefox browser.
  Same in your last line of ajaxSubmit dataType: 'null',.

  Jörn

Oh my God! I'm a luser... :(

What is the good solution for non-firefox browsers?

Thank you very much!

András
-- 
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell


[jQuery] validate with form plugin

2008-05-11 Thread András Csányi
Hi all!

I'm new in jquery and i have a queston. Somebody knows usable example
like this to using form plugin with validate
plugin(http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-demo.html)?

I tried 4 hours writing a working code, but i have failed (and i'm
tired and nervos). I'm better in php and sql. Javascript isn't my
favorite language.

Thanks for the help and patience!

András

-- 
- -
-- Csanyi Andras -- http://sayusi.hu -- Sayusi Ando
-- Bízzál Istenben és tartsd szárazon a puskaport!.-- Cromwell