2

here is the screenshot where i am stuck:

enter image description here

the disabled fields row are not being stored to database after submit button please help !

Also, sometimes ago it use to work but now no more.. I am really stuck what the issue is and i have not made any such changes that create such issue..

before it used to store these stuffs, when fields are disabled:

ID, website, comapny type.

but now they are not working.. please help !

devilcrab
  • 141
  • 4
  • 21

5 Answers5

6

If you use disabled property, value of the field will not be submitted along with form.

What you have to do is use readonly attribute.


From https://stackoverflow.com/a/7730719/1288198:

read more about this in this great article or the definition by w3c. to quote the important part:

Key Differences

The Disabled attribute

  • Values for disabled form elements are not passed to the processor method. The W3C calls this a successful element.(This works similar to form check boxes that are not checked.)
  • Some browsers may override or provide default styling for disabled form elements. (Gray out or emboss text) Internet Explorer 5.5 is particularly nasty about this.
  • Disabled form elements do not receive focus.
  • Disabled form elements are skipped in tabbing navigation.

The Read Only Attribute

  • Not all form elements have a readonly attribute. Most notable, the <SELECT> , <OPTION> , and <BUTTON> elements do not have readonly attributes (although thy both have disabled attributes)
  • Browsers provide no default overridden visual feedback that the form element is read only. (This can be a problem… see below.)
  • Form elements with the readonly attribute set will get passed to the form processor.
  • Read only form elements can receive the focus
  • Read only form elements are included in tabbed navigation.
Community
  • 1
  • 1
Ashwini Agarwal
  • 4,828
  • 2
  • 42
  • 59
1

Try use

<INPUT NAME="name" VALUE="Hi There" READONLY>

instead of

<INPUT NAME="name" VALUE="Hi There" DISABLED>
6339
  • 475
  • 3
  • 16
0

Get Input fields are readonly to prevent changes and getting values in $_POST. In select tag use disabled and put hidden field for it.

Deval Shah
  • 1,094
  • 8
  • 22
0

yes you can not insert disabled field, you have to make your form readonly as answered above by deepu use

<input type='text' name='test' readonly="readonly" />
Dinesh
  • 447
  • 1
  • 6
  • 22
0

Never mind i got the answer.. !

i just restarted sql and did some tweaks and that works !

devilcrab
  • 141
  • 4
  • 21
  • What did you tweak? It will be useful for other people to know how you fixed the problem. – Simon MᶜKenzie May 02 '13 at 05:47
  • first: i shutdown sql; second: cleaned cache, cookies, history. third: shutdown full apache and restarted PC. fourth: Restarted Apache, SQL . and tried it.. and that worked ! just as it should.. it don't store the disabled field and save them as null.. and save rest all data as it was doing previously... The issue overall i think was as i installed MySQL oracle benchmark .. due to it that all was started.. :\ – devilcrab May 02 '13 at 05:51