Mail/Login: Password : forgot my password!

GHANIFIED! form2param

Direct link
Written by -GHAN- // Tags: ghanified form2param

Available from : v0.3
needs : GHCORE Object

The function is intended to grab a the values of a whole form and return it as a param string. This makes is easy to just send a form back to uniface via AJAX or just get data from there depending on inputs.

Before we look at the Usage, let's look at a URL and how it's set up:

The first part is the adress to it all- nothing new to us. But the bold part is interesting. Those are the params to the server page, initiated by a "?" and followed by pears of FIELDS and VALUES. Please be aware of, that only the FIRST parameter is prefixed with "?". The others just hold a "&". Conluding this:

- 1st param is declared by ?FIELDNAME=VALUE
- all following params are declared like &FIELDNAME=VALUE


Sorry- ... please log-in or register to get this!

It's straight down the road. Tell it the name of the form and you'll be served.

Return value

As I told, the first parameter is always a "?". But while using this function, you'll aperhaps already have some values in a URL and maybe want to append the inputs from a form to it.
Because of that, GHFORM2PARAM just leaves out the first indicator so you can connect it to, wherever you want. The String returned looks like:
Content of the return value SOURCE CODE
Sorry- ... please log-in or register to get this!


The values are taken from all input fields within the stated. On radio buttons, it takes the one which is selected. Same is done with checkboxes, which (of course) are checked.

Back to the overview of GHANIFIED! ... a JavaScript ToolKit


on 2011-02-08 17:55:20 -GHAN- wrote:

Well Frank, that depends. I prefer POST as the string can get longer than 1024 Byte. Within Uniface do cross-check the data with things like OCCCRC and decide then, WHICH information is of use, and which seems crap. I never take the things in $webinfo(input) for SAFE :) ...

on 2011-02-07 17:40:38 FrankSjoukes wrote:

What do you do in AJAX a GET or a POST? Updating based on on a query-string is highly dangerous. Frank

1001 view(s) / 2010-09-23 12:17:47 / LAST UPDATED: 2010-11-10 11:39:43