[xwiki-users] Parsing textbox data
Hello again ! I want to take a string entered into a textbox and place it into a MySQL db (which is not XWiki's RDB). For that I created a simple form shown below - <form action = "VelocityTest2" method = "get" > <input type = "text" name = "formval"> <input type = "submit" value = "submit"> </form> This is the velocity page (named VelocityTest2) which is supposed to parse the string entered into the text box - #set($groovyObject = $xwiki.parseGroovyFromPage("Amrita IIS.GroovyTest4")) #set($j = $Request.getParameterValues('formval')) $groovyObject.SQL_conn($j) A Groovy page (named GroovyTest4) takes that string and enters it into the MySQL db with the SQL_conn() function and I'm positive that my groovy code works. My problem is that the string is not being parsed from the textbox into the Velocity page. I am getting a null value instead. Thanks, Harikrishnan -- View this message in context: http://www.nabble.com/Parsing-textbox-data-tf4724953.html#a13508865 Sent from the XWiki- Users mailing list archive at Nabble.com.
hi, I think this should work: #set($j = $request.formval) Vito V. Harikrishnan Nair wrote:
Hello again !
I want to take a string entered into a textbox and place it into a MySQL db (which is not XWiki's RDB). For that I created a simple form shown below -
<form action = "VelocityTest2" method = "get" > <input type = "text" name = "formval"> <input type = "submit" value = "submit"> </form>
This is the velocity page (named VelocityTest2) which is supposed to parse the string entered into the text box -
#set($groovyObject = $xwiki.parseGroovyFromPage("Amrita IIS.GroovyTest4")) #set($j = $Request.getParameterValues('formval')) $groovyObject.SQL_conn($j)
A Groovy page (named GroovyTest4) takes that string and enters it into the MySQL db with the SQL_conn() function and I'm positive that my groovy code works.
My problem is that the string is not being parsed from the textbox into the Velocity page. I am getting a null value instead.
Thanks, Harikrishnan
Check that you're using correct case as well. Also, you will need to be careful with quote marks, as these need to be escaped by putting two together before sending into a sql query - so for example, O'Hara Airport should read O''Hara Airport when added to a sql statement. -----Original Message----- From: users-bounces@xwiki.org [mailto:users-bounces@xwiki.org] On Behalf Of Vitantonio Messa Sent: 31 October 2007 13:17 To: XWiki Users Subject: Re: [xwiki-users] Parsing textbox data hi, I think this should work: #set($j = $request.formval) Vito V. Harikrishnan Nair wrote:
Hello again !
I want to take a string entered into a textbox and place it into a
MySQL db (which is not XWiki's RDB). For that I created a simple form shown below -
<form action = "VelocityTest2" method = "get" > <input type = "text" name = "formval"> <input type = "submit" value = "submit"> </form>
This is the velocity page (named VelocityTest2) which is supposed to parse the string entered into the text box -
#set($groovyObject = $xwiki.parseGroovyFromPage("Amrita IIS.GroovyTest4")) #set($j = $Request.getParameterValues('formval')) $groovyObject.SQL_conn($j)
A Groovy page (named GroovyTest4) takes that string and enters it into
the MySQL db with the SQL_conn() function and I'm positive that my groovy code works.
My problem is that the string is not being parsed from the textbox into the Velocity page. I am getting a null value instead.
Thanks, Harikrishnan
users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
It's perfect ! Thank you, Vito. Vitantonio Messa wrote:
hi,
I think this should work: #set($j = $request.formval)
Vito
V. Harikrishnan Nair wrote:
Hello again !
I want to take a string entered into a textbox and place it into a MySQL db (which is not XWiki's RDB). For that I created a simple form shown below -
<form action = "VelocityTest2" method = "get" > <input type = "text" name = "formval"> <input type = "submit" value = "submit"> </form>
This is the velocity page (named VelocityTest2) which is supposed to parse the string entered into the text box -
#set($groovyObject = $xwiki.parseGroovyFromPage("Amrita IIS.GroovyTest4")) #set($j = $Request.getParameterValues('formval')) $groovyObject.SQL_conn($j)
A Groovy page (named GroovyTest4) takes that string and enters it into the MySQL db with the SQL_conn() function and I'm positive that my groovy code works.
My problem is that the string is not being parsed from the textbox into the Velocity page. I am getting a null value instead.
Thanks, Harikrishnan
users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
-- View this message in context: http://www.nabble.com/Parsing-textbox-data-tf4724953.html#a13523140 Sent from the XWiki- Users mailing list archive at Nabble.com.
participants (3)
-
Esbach, Brandon -
V. Harikrishnan Nair -
Vitantonio Messa