jQuery Form Variables
jQuery has many examples and demos on their website and has a large community of developers creating plugins. One of the things I needed to figure out was how to pass form variables using jQuery. I found a sample code on their website but I just couldn’t get it to work – http://docs.jquery.com/Ajax/jQuery.post. I couldn’t pass the form variable over. Their sample code was
So I started to play around with it more and was able to get it to work. Here’s the new code now based on the example.
After reading a few comments about this function, a couple suggested to use serialize() but I have yet to figure that out. At least my variables are passing as they should. The same syntax for the variables can be applied to $.get.
If you are going to copy to code above, make sure you are using apostrophes. For some reason, it’s displaying the “tick” symbol which is the one sharing the key with the tilde ~ on your keyboard. It looks like an apostrophe but more slanted. So be aware of that.