2

I write a selection of ids (e.g. "3,4,31") in a disabled textarea (works fine so far) and want to submit that via GET. I don't understand why I keep getting an undefined index error with the following code:

<form action="slider/Jssor/image-gallery.source.php" method="get"><br>
  <textarea name="selection" id="result" disabled></textarea>
  <input type="submit" value="Jssor Imgage Gallery">
</form>

image-gallery.source.php throws the undefined index error when calling:

<?php
  echo $_GET["selection"];
?>

The link to the new page works fine so I assume it can't be because of the path in the action attribute!? I don't see the Ids transported in the URL (?selection=3,4,31), so what am I doing wrong?

Pete
  • 502
  • 1
  • 6
  • 20

4 Answers4

2

Your textarea is not being sent with the form because it's marked as disabled. You should mark it as readonly if you want it to be sent.

As is stated in http://www.w3schools.com/tags/att_input_disabled.asp:

Tip: Disabled elements in a form will not be submitted.

Manuel Miranda
  • 823
  • 5
  • 13
1

change

 <textarea name="selection" id="result" disabled></textarea>

to

<textarea name="selection" id="result" readonly></textarea>
Ezhil
  • 996
  • 8
  • 13
0

Replace

   <textarea name="selection" id="result" disabled></textarea>

With

 <textarea name="selection" id="result" readonly></textarea>
Rajendra Yadav
  • 645
  • 3
  • 12
0

We have progressed after passing -d. GET works fine and it can identify the submitted value however in case of POST it does not work.

kta
  • 19,412
  • 7
  • 65
  • 47