Developer
Supported
GET and POST Variables
ExpressionEngine 1.x, ExpressionEngine 2
Back to this add-on's main page
View Other Add-ons From Laisvunas
Can this be used with ajax?
General
Amit
|
Posted: 09 February 2011 04:59 AM |
|
|
|
Hi,
I would like to see a full example with this plugin before investing. Could you show me an example with ajax where upon form submission, certain actions happen?
This add-on seems very interesting but also, is it safe to pass variables like that in the system?
|
|
|
Laisvunas
|
Posted: 09 February 2011 09:38 AM |
# 1
|
|
Developer
|
Hi Amit,
It surely can be used with AJAX. See this demo where this plugin is being used (If you are interested in code of this demo see here at the bottom).
The use of this plugin is sage because outputted values are sanitized using ExpressionEngine’s xss_clean function.
|
|
|
Amit
|
Posted: 09 February 2011 10:00 AM |
# 2
|
|
|
Am confused. This is an example from the commenters plugin. I saw the part of the code that was part of the ajax example but could not relate it to say how a simple form submit would work.
Will take another look. Better documentation of GET and POST Variables add-on would definitely prove its value to newbies like me.
|
|
|
|
Amit
|
Posted: 09 February 2011 10:12 AM |
# 4
|
|
|
Ok - This is making more sense now - Can you just show me the code for the form + EE tags? I think I’ll get it
|
|
|
Laisvunas
|
Posted: 09 February 2011 10:16 AM |
# 5
|
|
Developer
|
The code of the page containing form:
<html> <head>
<title>GET and POST Variables plugin's demo</title>
</head>
<body>
<h1>GET and POST Variables plugin's demo</h1>
<p> Type any string and submit the form. The string (the value of variable "my_variable") will be outputted using the tag exp:get_post_vars in the page that will load after submission. </p>
<form action="{homepage}/technical/demo/get_and_post_variables_plugin_demo2/" method="post">
<textarea name="my_variable" rows="15" cols="48">
</textarea>
<p><input type="submit" name="submit" value="Submit" /></p>
</form>
</body> </html>
The code of the page that loads after the form has been submitted:
<html> <head>
<title>GET and POST Variables plugin's demo</title>
</head>
<body>
<h1>GET and POST Variables plugin's demo</h1>
<p> The variable "my_variable" has the value: {exp:get_post_vars}{post_my_variable}{/exp:get_post_vars} </p>
<a nclick="history.go(-1)">Back</a>
</body> </html>
|
|
|
Amit
|
Posted: 09 February 2011 02:23 PM |
# 6
|
|
|
Great - Got it - Thanks!
|
|
|
casey
|
Posted: 05 May 2011 11:52 PM |
# 7
|
|
|
Is is possible to use this in another EE form tag like freeform or {exp:member:login_form}?
I’m having problems just trying to make a simple sticky form..
<input class="txtinp {required:true}" name="email" type="text" value="{exp:get_post_vars}{post_email}{/exp:get_post_vars}" />
|
|
|