[jQuery] UNSUSCRIBE

2010-01-19 Thread Juan Ignacio Borda

unsuscribe
attachment: juanignacioborda.vcf

Re: [jQuery] not able to receive POST data in php file

2009-12-21 Thread Juan Ignacio Borda

try a var_dump($_REQUEST) to see what's being submited.


 Original Message 

i am using the following JQuery function to successfully POST data
to the user_submit.php file, its just that the php file is unable to
receive the data.

$(function() {
  $(#submit_js).click(function() {
$.post(user_submit.php, {
  comment: $(#comment).val()
});
  });
});

upon finishing the Firebug consoloe shows this:

html
body
Your vote was successfully registered!any text but this
/body
/html

i am pasting the user_submit.php here:

?php

$vote = $_REQUEST['vote'];
$aid = $vote;


//$comment = $_REQUEST['#comment'];
//$comment = print_r($_POST);
$comment = htmlspecialchars($_POST[comment]);
//$comment = $_POST['comment'];
//echo htmlspecialchars($comment);
//$comment = $_POST['comment'];
//echo $comment;

// include configuration file
include('config.php');

// open database connection
$connection = mysql_connect($host, $user, $pass) or die('ERROR:
Unable to connect!');

// select database
mysql_select_db($db) or die('ERROR: Unable to select database!');

// update vote counter
$query = UPDATE answers SET acount = acount + 1 WHERE aid =
$vote;
$result = mysql_query($query);
$cadd = INSERT INTO comments (comment,aid) VALUES ('$comment',
'$aid');
mysql_query($cadd);

// close connection
mysql_close($connection);

// print success message
echo 'Your vote was successfully registered!';
echo $comment;
//print_r(array_count_value($comment));

?


this is the HTML :
div id=greetings
You are voting out b style=color:
#00b0de; id=roadiename/b. Care to explain why?br/br/
textarea name=textarea id=comment
cols=38 rows=7textarea/textareabr
a href=# id=submit_jsimg
src=images/submit.gif style=border: none; float:right; padding-top:
10px;padding-right: 10px;//a
/div


When I click on Submit, I can see in Firebug console that the data is
being POSTed. but i am not receiving that data in the php file. or
else i am not able to use it.

please help.



  



attachment: juanignacioborda.vcf

Re: [jQuery] Re: running an onload code snippet only once

2009-12-16 Thread Juan Ignacio Borda

try using:
$(document).ready(function(){

...your code here

});

this is the JQuery way

 Original Message 

Those events window.onload, in jQuery, that would be $(window).load
(...), should *not* be firing at any time other than when the document
loads the first time... something else has to be going on with your
code to fire off that code again

On Dec 15, 3:27 pm, Richard KLINDA rkli...@gmail.com wrote:
  

Hello, what is a good way to run a code snippet after the page is
loaded, but only just one time?

I use the ready event $(function(){...}); most of the time, but
sometimes it fires multiple times (when the DOM changes I think), and
rarely there are stuff that I only want to run JUST ONCE per pageload.

What is a good way to achieve that?

Now I do window.onload = function() {...}, but I hope there is something
better.

Thanks in advance...

--
Richard



  



attachment: juanignacioborda.vcf

Re: [jQuery] Random problems with load()?????

2009-12-09 Thread Juan Ignacio Borda
try using firebug for firefox and look at the NET tab for response of 
the server.


 Original Message 

Hello everyone!
I'm using load() to get some php content in ti a div, the PHP has a 
long switch() conditional that brings back contents depending on var 
received, it works fine, almost all the time...
Sometimes, the load function doesn't load anything, there's a callback 
function for the load event, and it fires correctly, but nothing get 
loaded.
It is not a PHP problem cause if I pass the var via URL to the PHP 
document it works, even further, the same request sometimes works, 
sometimes not...

Is this common? Can I get any error report from the load() function?





attachment: juanignacioborda.vcf

Re: [jQuery] Validate: a question about the Remote option

2009-12-01 Thread Juan Ignacio Borda

you have to actually echo the result of validation: true or false

 Original Message 

Hello everyone,

I'm still dealing with that signup form.
Now I'd like to check with an Ajax call if a login is already taken.
That's what I'm doing:

$(#signup).validate( {
rules: {
ulogin: {
required: true,
// It's a custom method checking a regexp, it's working
login: true,
rangelength: [3,20],
remote: check.php?w=1
},
   ...

Here's the check.php file:

// Including the connection file, blah blah
...
$valid=true;
// Since I'm planning to use this file as a multipurpose script,
//preventing it from stop working
if (!isset($_REQUEST['w'])) $_REQUEST['w']=1;
if ($_REQUEST['w']==1) {
// If the login is taken, it will return something 0
$number=mysql_num_rows(mysql_query(SELECT `Id` FROM `Users` WHERE 
`Login`='.$_REQUEST['ulogin'].', $link));
if ($number0) $valid=false; else $valid=true;
}
After I validate, it stops working: it says incorrect for all fields
after the second submit. After the first submit it says nothing, even
that the login is already taken.
What's wrong?
Thanks!

  



attachment: juanignacioborda.vcf

Re: [jQuery] Validate: a question about the Remote option

2009-11-30 Thread Juan Ignacio Borda
hey..!!! you have to actually ECHO the result of your validation the 
remote method expects the response to be true or false.


good luck!
 Original Message 

Hello everyone,

I'm still dealing with that signup form.
Now I'd like to check with an Ajax call if a login is already taken.
That's what I'm doing:

$(#signup).validate( {
rules: {
ulogin: {
required: true,
// It's a custom method checking a regexp, it's working
login: true,
rangelength: [3,20],
remote: check.php?w=1
},
   ...

Here's the check.php file:

// Including the connection file, blah blah
...
$valid=true;
// Since I'm planning to use this file as a multipurpose script,
//preventing it from stop working
if (!isset($_REQUEST['w'])) $_REQUEST['w']=1;
if ($_REQUEST['w']==1) {
// If the login is taken, it will return something 0
$number=mysql_num_rows(mysql_query(SELECT `Id` FROM `Users` WHERE 
`Login`='.$_REQUEST['ulogin'].', $link));
if ($number0) $valid=false; else $valid=true;
}
After I validate, it stops working: it says incorrect for all fields
after the second submit. After the first submit it says nothing, even
that the login is already taken.
What's wrong?
Thanks!

  



attachment: juanignacioborda.vcf