4 Replies - 447 Views - Last Post: 27 May 2012 - 11:22 PM Rate Topic: -----

#1 Share  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-May 12

Retrieving PHP Textbox values in Self Submit

Posted 27 May 2012 - 08:44 PM

Hey guys,
How do I retrieve a the php value stored in the textbox?

EG
<input disabled="disabled" type="text" size="25" name="dob" value="<?php echo $row["DOB"] ?>" />

I have tried to use

$dateOfBirth = $_POST["dob"];
echo $dateOfBirth


But however it does not work. It works when its something like this:

<input disabled="disabled" type="text" size="25" name="dob" value="Hello" />

Can someone help ASAP. Thank you in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Retrieving PHP Textbox values in Self Submit

#2 xxxjj18  Icon User is online

  • D.I.C Head
  • member icon

Reputation: 49
  • View blog
  • Posts: 166
  • Joined: 30-November 11

Re: Retrieving PHP Textbox values in Self Submit

Posted 27 May 2012 - 09:21 PM

If the input field is disabled, then its value is not stored in $_POST

This post has been edited by xxxjj18: 27 May 2012 - 11:11 PM

Was This Post Helpful? 1
  • +
  • -

#3 Share  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-May 12

Re: Retrieving PHP Textbox values in Self Submit

Posted 27 May 2012 - 10:46 PM

View Postxxxjj18, on 27 May 2012 - 09:21 PM, said:

If the input field is disabled, then its value is not stored in $_POST

May I see the rest of the code?


Ahhh Yea, how would i store the value if i disabled the textbox, because when i got rid of the disabled it actually worked.
Was This Post Helpful? 0
  • +
  • -

#4 xxxjj18  Icon User is online

  • D.I.C Head
  • member icon

Reputation: 49
  • View blog
  • Posts: 166
  • Joined: 30-November 11

Re: Retrieving PHP Textbox values in Self Submit

Posted 27 May 2012 - 11:10 PM

You can use the readonly attribute; the content won't be editable and it will still display in the textbox.

http://www.w3schools...ut_readonly.asp
Was This Post Helpful? 1
  • +
  • -

#5 Share  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 27-May 12

Re: Retrieving PHP Textbox values in Self Submit

Posted 27 May 2012 - 11:22 PM

View Postxxxjj18, on 27 May 2012 - 11:10 PM, said:

You can use the readonly attribute; the content won't be editable and it will still display in the textbox.

http://www.w3schools...ut_readonly.asp


Thank you very much!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1