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
It's straight down the road. Tell it the name of the form and you'll be served.
Return valueAs 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:
NotesThe 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.
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 :) ...
What do you do in AJAX a GET or a POST? Updating based on on a query-string is highly dangerous. Frank