• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

RESOLVED not possible to access stored $_GET data in array, from input fields generated with javascript

Messages
4
Likes
0
Points
1
#1
This issue worked with the [insert_php] method, but not with the Woody snippets.
Graphical view on web, see attached file
----------------------------------
I have following form, where the fields are generated with javascript (js):
<form method='GET' action='my-result'>
<input type='text' name='firstname[]'>
<input type='text' name='lastname[]'>
<input type='button' value='Add a text field' onClick='myFunctionAddRow()' />
</form>
---------------------------------
In my file my-result I call the values of the input files:

$author_firstname = $_REQUEST['firstname'];
$author_lastname = $_REQUEST['lastname'];

and wanted to write them out

echo $author_firstname[0]; (the value of the field was passed)
echo $author_firstname[1]; (the value of the field was not passed)
echo $author_lastname[0]; (the value of the field was passed)
echo $author_lastname[1]; (the value of the field was not passed)

The text input fields that were not generated by javascript, here ....[0]), were passed to the my-result file
The text input fields that were generated by javascript, here ....[1]), were NOT passed to the my-result file

.................................................

I also tried to save several values of fields - NOT generated by js - into an array. All these values were passed. So not the array is the problem.
So there is something with the woody snippet which does not work with the javascript, generating rows ?
And again, the javascript, that generated rows, worked with the [insert_php] method.

Thanks so much for your suggestions.
 

Attachments

Temyk

Support team
Staff member
Messages
186
Likes
12
Points
18
#2
Hello.

If you send the form using the GET METHOD, you should see all the passed parameters in the address bar. Check if all form fields are passed in the address bar?