Home > Back-end >  how can i transfer input data in form with value using GET method
how can i transfer input data in form with value using GET method

Time:01-04

I have a form and it has an input in it. I normally auto-fill this with javascript, but I didn't add this code because I know the problem is not in javascript. My main problem is that I fill the input using the value from the input and I have to give the input a disabled property. Here is the code:

<form action="testget.php" method="GET">
  <input disabled type="text" name="testget" value="testvalue">
  <button type="submit">Send</button>
</form>

When I press the send button, the url it will redirect me to should be:

localhost/testget.php?testget=testvalue

but here is the problem. The url it redirected me to:

localhost/testget.php?

I don't know if I misunderstood the value property, but how I tried to search on the internet, I could not find a solution for it. I will be glad if you help me.

I was trying and expecting for the data in the form to be transferred to testget.php.

CodePudding user response:

try to make the `disabled` part to `readonly` in your code
  • Related