Form elements not being submitted
up vote
0
down vote
favorite
So I've got a weird problem that I'm having a hard time figuring out. I've got a simple form with a few elements that are not being submitted, all of these elements have only one thing in common, they're select elements:
echo $this->Form->control("spirit_type_id", [
"label" => false,
"type" => "select",
"options" => $spirit_types,
"empty" => "Spirit Type"
]);
echo $this->Form->control("country_id", [
"label" => false,
"type" => "select",
"options" => $countries,
"empty" => "Country"
]);
echo $this->Form->control("region_id", [
"label" => false,
"type" => "select",
"options" => $regions,
"empty" => "Region"
]);
And in my controller I have:
public function add() {
$spirit = $this->Spirits->newEntity();
$spirit_types = $this->Spirits->SpiritTypes->find("list");
$countries = $this->Spirits->Countries->find("list");
$regions = $this->Spirits->Regions->find("list");
if ($this->request->is("post")) {
debug($this->request->getData());
die();
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
$spirit->user_id = $this->Auth->user("id");
if ($this->Spirits->save($spirit)) {
$this->Flash->success("Your spirit was successfully saved.");
$this->redirect(["action" => "index"]);
} else {
$this->Flash->error("Your spirit could not be saved.");
}
}
$this->set(compact("spirit", "spirit_types", "countries", "regions"));
}
The important part is that debug statement. It shows this when I insert data using the form.
[
'name' => 'Longrow Peated',
'image' => 'imageLocation',
'brand' => 'Springbank',
'age' => '',
'cost' => '55'
]
Those are all text and/or number elements in my form, and they all come out just fine. It gets a little weirder though. I have validation in my table to require those id fields:
public function validationDefault(Validator $validator) {
$validator->requirePresence(
"name", "brand", "spirit_type_id", "country_id", "region_id", "age", "cost", "image"
)
->notEmpty("name", "We require a name")
->notEmpty("brand", "We require a brand or distillery")
->notEmpty("spirit_type_id", "We require a type of alchohol")
->notEmpty("country_id", "We require a country of origin")
But this doesn't ever seem to get triggered when I insert the data using patchEntity, it's only caught when I actually call the save function and I try inserting into the database.
cakephp cakephp-3.0
add a comment |
up vote
0
down vote
favorite
So I've got a weird problem that I'm having a hard time figuring out. I've got a simple form with a few elements that are not being submitted, all of these elements have only one thing in common, they're select elements:
echo $this->Form->control("spirit_type_id", [
"label" => false,
"type" => "select",
"options" => $spirit_types,
"empty" => "Spirit Type"
]);
echo $this->Form->control("country_id", [
"label" => false,
"type" => "select",
"options" => $countries,
"empty" => "Country"
]);
echo $this->Form->control("region_id", [
"label" => false,
"type" => "select",
"options" => $regions,
"empty" => "Region"
]);
And in my controller I have:
public function add() {
$spirit = $this->Spirits->newEntity();
$spirit_types = $this->Spirits->SpiritTypes->find("list");
$countries = $this->Spirits->Countries->find("list");
$regions = $this->Spirits->Regions->find("list");
if ($this->request->is("post")) {
debug($this->request->getData());
die();
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
$spirit->user_id = $this->Auth->user("id");
if ($this->Spirits->save($spirit)) {
$this->Flash->success("Your spirit was successfully saved.");
$this->redirect(["action" => "index"]);
} else {
$this->Flash->error("Your spirit could not be saved.");
}
}
$this->set(compact("spirit", "spirit_types", "countries", "regions"));
}
The important part is that debug statement. It shows this when I insert data using the form.
[
'name' => 'Longrow Peated',
'image' => 'imageLocation',
'brand' => 'Springbank',
'age' => '',
'cost' => '55'
]
Those are all text and/or number elements in my form, and they all come out just fine. It gets a little weirder though. I have validation in my table to require those id fields:
public function validationDefault(Validator $validator) {
$validator->requirePresence(
"name", "brand", "spirit_type_id", "country_id", "region_id", "age", "cost", "image"
)
->notEmpty("name", "We require a name")
->notEmpty("brand", "We require a brand or distillery")
->notEmpty("spirit_type_id", "We require a type of alchohol")
->notEmpty("country_id", "We require a country of origin")
But this doesn't ever seem to get triggered when I insert the data using patchEntity, it's only caught when I actually call the save function and I try inserting into the database.
cakephp cakephp-3.0
No chance you did something silly like close the form before you output those fields? They look fine. Check your browser console to look at exactly what data is being posted, to narrow down whether it's not being sent from the browser vs being lost somehow on the server side?
– Greg Schmidt
Nov 9 at 6:02
@GregSchmidt Yes the data being sent in the headers is the same as the data being displayed in the debug output. I've gone over the form and it's not being closed prematurely.
– Arak Tai'Roth
Nov 9 at 16:47
Well, the problem is pretty obviously in your form, I guess. Check the HTML of the page with a validator service to see if there's some problem? Even the DOM inspector built into most browsers might be able to show you. Or, if you can post the URL, people could look at it.
– Greg Schmidt
Nov 9 at 17:18
@GregSchmidt No errors using the W3C Validator. I have no URL to share, this is entirely on localhost for the time being.
– Arak Tai'Roth
Nov 10 at 9:21
@GregSchmidt Despite there being no errors, you were indeed correct. I had a couple custom form elements that I was using, and one of them was for select buttons. I was copying and pasting the original form elements and then just modifying them, but apparently I modified the name attribute out of it, and that's what did it. If you want to offer yours as an answer, I would be happy to accept it.
– Arak Tai'Roth
Nov 10 at 22:05
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
So I've got a weird problem that I'm having a hard time figuring out. I've got a simple form with a few elements that are not being submitted, all of these elements have only one thing in common, they're select elements:
echo $this->Form->control("spirit_type_id", [
"label" => false,
"type" => "select",
"options" => $spirit_types,
"empty" => "Spirit Type"
]);
echo $this->Form->control("country_id", [
"label" => false,
"type" => "select",
"options" => $countries,
"empty" => "Country"
]);
echo $this->Form->control("region_id", [
"label" => false,
"type" => "select",
"options" => $regions,
"empty" => "Region"
]);
And in my controller I have:
public function add() {
$spirit = $this->Spirits->newEntity();
$spirit_types = $this->Spirits->SpiritTypes->find("list");
$countries = $this->Spirits->Countries->find("list");
$regions = $this->Spirits->Regions->find("list");
if ($this->request->is("post")) {
debug($this->request->getData());
die();
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
$spirit->user_id = $this->Auth->user("id");
if ($this->Spirits->save($spirit)) {
$this->Flash->success("Your spirit was successfully saved.");
$this->redirect(["action" => "index"]);
} else {
$this->Flash->error("Your spirit could not be saved.");
}
}
$this->set(compact("spirit", "spirit_types", "countries", "regions"));
}
The important part is that debug statement. It shows this when I insert data using the form.
[
'name' => 'Longrow Peated',
'image' => 'imageLocation',
'brand' => 'Springbank',
'age' => '',
'cost' => '55'
]
Those are all text and/or number elements in my form, and they all come out just fine. It gets a little weirder though. I have validation in my table to require those id fields:
public function validationDefault(Validator $validator) {
$validator->requirePresence(
"name", "brand", "spirit_type_id", "country_id", "region_id", "age", "cost", "image"
)
->notEmpty("name", "We require a name")
->notEmpty("brand", "We require a brand or distillery")
->notEmpty("spirit_type_id", "We require a type of alchohol")
->notEmpty("country_id", "We require a country of origin")
But this doesn't ever seem to get triggered when I insert the data using patchEntity, it's only caught when I actually call the save function and I try inserting into the database.
cakephp cakephp-3.0
So I've got a weird problem that I'm having a hard time figuring out. I've got a simple form with a few elements that are not being submitted, all of these elements have only one thing in common, they're select elements:
echo $this->Form->control("spirit_type_id", [
"label" => false,
"type" => "select",
"options" => $spirit_types,
"empty" => "Spirit Type"
]);
echo $this->Form->control("country_id", [
"label" => false,
"type" => "select",
"options" => $countries,
"empty" => "Country"
]);
echo $this->Form->control("region_id", [
"label" => false,
"type" => "select",
"options" => $regions,
"empty" => "Region"
]);
And in my controller I have:
public function add() {
$spirit = $this->Spirits->newEntity();
$spirit_types = $this->Spirits->SpiritTypes->find("list");
$countries = $this->Spirits->Countries->find("list");
$regions = $this->Spirits->Regions->find("list");
if ($this->request->is("post")) {
debug($this->request->getData());
die();
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
$spirit->user_id = $this->Auth->user("id");
if ($this->Spirits->save($spirit)) {
$this->Flash->success("Your spirit was successfully saved.");
$this->redirect(["action" => "index"]);
} else {
$this->Flash->error("Your spirit could not be saved.");
}
}
$this->set(compact("spirit", "spirit_types", "countries", "regions"));
}
The important part is that debug statement. It shows this when I insert data using the form.
[
'name' => 'Longrow Peated',
'image' => 'imageLocation',
'brand' => 'Springbank',
'age' => '',
'cost' => '55'
]
Those are all text and/or number elements in my form, and they all come out just fine. It gets a little weirder though. I have validation in my table to require those id fields:
public function validationDefault(Validator $validator) {
$validator->requirePresence(
"name", "brand", "spirit_type_id", "country_id", "region_id", "age", "cost", "image"
)
->notEmpty("name", "We require a name")
->notEmpty("brand", "We require a brand or distillery")
->notEmpty("spirit_type_id", "We require a type of alchohol")
->notEmpty("country_id", "We require a country of origin")
But this doesn't ever seem to get triggered when I insert the data using patchEntity, it's only caught when I actually call the save function and I try inserting into the database.
cakephp cakephp-3.0
cakephp cakephp-3.0
asked Nov 9 at 3:38
Arak Tai'Roth
301523
301523
No chance you did something silly like close the form before you output those fields? They look fine. Check your browser console to look at exactly what data is being posted, to narrow down whether it's not being sent from the browser vs being lost somehow on the server side?
– Greg Schmidt
Nov 9 at 6:02
@GregSchmidt Yes the data being sent in the headers is the same as the data being displayed in the debug output. I've gone over the form and it's not being closed prematurely.
– Arak Tai'Roth
Nov 9 at 16:47
Well, the problem is pretty obviously in your form, I guess. Check the HTML of the page with a validator service to see if there's some problem? Even the DOM inspector built into most browsers might be able to show you. Or, if you can post the URL, people could look at it.
– Greg Schmidt
Nov 9 at 17:18
@GregSchmidt No errors using the W3C Validator. I have no URL to share, this is entirely on localhost for the time being.
– Arak Tai'Roth
Nov 10 at 9:21
@GregSchmidt Despite there being no errors, you were indeed correct. I had a couple custom form elements that I was using, and one of them was for select buttons. I was copying and pasting the original form elements and then just modifying them, but apparently I modified the name attribute out of it, and that's what did it. If you want to offer yours as an answer, I would be happy to accept it.
– Arak Tai'Roth
Nov 10 at 22:05
add a comment |
No chance you did something silly like close the form before you output those fields? They look fine. Check your browser console to look at exactly what data is being posted, to narrow down whether it's not being sent from the browser vs being lost somehow on the server side?
– Greg Schmidt
Nov 9 at 6:02
@GregSchmidt Yes the data being sent in the headers is the same as the data being displayed in the debug output. I've gone over the form and it's not being closed prematurely.
– Arak Tai'Roth
Nov 9 at 16:47
Well, the problem is pretty obviously in your form, I guess. Check the HTML of the page with a validator service to see if there's some problem? Even the DOM inspector built into most browsers might be able to show you. Or, if you can post the URL, people could look at it.
– Greg Schmidt
Nov 9 at 17:18
@GregSchmidt No errors using the W3C Validator. I have no URL to share, this is entirely on localhost for the time being.
– Arak Tai'Roth
Nov 10 at 9:21
@GregSchmidt Despite there being no errors, you were indeed correct. I had a couple custom form elements that I was using, and one of them was for select buttons. I was copying and pasting the original form elements and then just modifying them, but apparently I modified the name attribute out of it, and that's what did it. If you want to offer yours as an answer, I would be happy to accept it.
– Arak Tai'Roth
Nov 10 at 22:05
No chance you did something silly like close the form before you output those fields? They look fine. Check your browser console to look at exactly what data is being posted, to narrow down whether it's not being sent from the browser vs being lost somehow on the server side?
– Greg Schmidt
Nov 9 at 6:02
No chance you did something silly like close the form before you output those fields? They look fine. Check your browser console to look at exactly what data is being posted, to narrow down whether it's not being sent from the browser vs being lost somehow on the server side?
– Greg Schmidt
Nov 9 at 6:02
@GregSchmidt Yes the data being sent in the headers is the same as the data being displayed in the debug output. I've gone over the form and it's not being closed prematurely.
– Arak Tai'Roth
Nov 9 at 16:47
@GregSchmidt Yes the data being sent in the headers is the same as the data being displayed in the debug output. I've gone over the form and it's not being closed prematurely.
– Arak Tai'Roth
Nov 9 at 16:47
Well, the problem is pretty obviously in your form, I guess. Check the HTML of the page with a validator service to see if there's some problem? Even the DOM inspector built into most browsers might be able to show you. Or, if you can post the URL, people could look at it.
– Greg Schmidt
Nov 9 at 17:18
Well, the problem is pretty obviously in your form, I guess. Check the HTML of the page with a validator service to see if there's some problem? Even the DOM inspector built into most browsers might be able to show you. Or, if you can post the URL, people could look at it.
– Greg Schmidt
Nov 9 at 17:18
@GregSchmidt No errors using the W3C Validator. I have no URL to share, this is entirely on localhost for the time being.
– Arak Tai'Roth
Nov 10 at 9:21
@GregSchmidt No errors using the W3C Validator. I have no URL to share, this is entirely on localhost for the time being.
– Arak Tai'Roth
Nov 10 at 9:21
@GregSchmidt Despite there being no errors, you were indeed correct. I had a couple custom form elements that I was using, and one of them was for select buttons. I was copying and pasting the original form elements and then just modifying them, but apparently I modified the name attribute out of it, and that's what did it. If you want to offer yours as an answer, I would be happy to accept it.
– Arak Tai'Roth
Nov 10 at 22:05
@GregSchmidt Despite there being no errors, you were indeed correct. I had a couple custom form elements that I was using, and one of them was for select buttons. I was copying and pasting the original form elements and then just modifying them, but apparently I modified the name attribute out of it, and that's what did it. If you want to offer yours as an answer, I would be happy to accept it.
– Arak Tai'Roth
Nov 10 at 22:05
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
If $this->request->getData()
is not showing all of your fields, the most likely cause would be some sort of problem with your form; there are not a lot of ways for CakePHP to discard your data from here. You can narrow it down by using browser tools (built into most of them now) to inspect the data actually being sent from your browser in the page request.
If it turns out that the fields really aren't being sent across at all, the problem is almost certainly in your form. For example, you might be closing it early, or there might be HTML errors that confuse the browser. Make sure that all of your input tags are between the <form>
and </form>
, and if they are then try an HTML validator to check your code. There are lots of options online, and even the inspectors built into browsers can often help you spot these sorts of issues.
add a comment |
up vote
0
down vote
This is the most common problem:
If you check debug($this->request->getData());
before $spirit = $this->Spirits->newEntity();
you then see all submitted data!
Next go to Spirit Entity and double check if your fields "spirit_type_id,.." accessible!
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'*' => true, // quick fix
'id' => false,
];
or better way:
protected $_accessible = [
'spirit_type_id' => true,
'country_id' => true,
// etc ...
];
Edit
debug
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
debug($spirit); exit();
see if any errors.
Where I've got my debug statement currently is perfectly adequate to see all submitted data. I've also gone through my SpiritEntity and confirmed that all of these fields are accessible. Although that shouldn't play a part in where my issue is, the data just isn't being sent from the form period.
– Arak Tai'Roth
Nov 9 at 16:48
debug$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
– Salines
Nov 9 at 16:53
no errors on debugging
– Arak Tai'Roth
Nov 10 at 9:13
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
If $this->request->getData()
is not showing all of your fields, the most likely cause would be some sort of problem with your form; there are not a lot of ways for CakePHP to discard your data from here. You can narrow it down by using browser tools (built into most of them now) to inspect the data actually being sent from your browser in the page request.
If it turns out that the fields really aren't being sent across at all, the problem is almost certainly in your form. For example, you might be closing it early, or there might be HTML errors that confuse the browser. Make sure that all of your input tags are between the <form>
and </form>
, and if they are then try an HTML validator to check your code. There are lots of options online, and even the inspectors built into browsers can often help you spot these sorts of issues.
add a comment |
up vote
1
down vote
accepted
If $this->request->getData()
is not showing all of your fields, the most likely cause would be some sort of problem with your form; there are not a lot of ways for CakePHP to discard your data from here. You can narrow it down by using browser tools (built into most of them now) to inspect the data actually being sent from your browser in the page request.
If it turns out that the fields really aren't being sent across at all, the problem is almost certainly in your form. For example, you might be closing it early, or there might be HTML errors that confuse the browser. Make sure that all of your input tags are between the <form>
and </form>
, and if they are then try an HTML validator to check your code. There are lots of options online, and even the inspectors built into browsers can often help you spot these sorts of issues.
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
If $this->request->getData()
is not showing all of your fields, the most likely cause would be some sort of problem with your form; there are not a lot of ways for CakePHP to discard your data from here. You can narrow it down by using browser tools (built into most of them now) to inspect the data actually being sent from your browser in the page request.
If it turns out that the fields really aren't being sent across at all, the problem is almost certainly in your form. For example, you might be closing it early, or there might be HTML errors that confuse the browser. Make sure that all of your input tags are between the <form>
and </form>
, and if they are then try an HTML validator to check your code. There are lots of options online, and even the inspectors built into browsers can often help you spot these sorts of issues.
If $this->request->getData()
is not showing all of your fields, the most likely cause would be some sort of problem with your form; there are not a lot of ways for CakePHP to discard your data from here. You can narrow it down by using browser tools (built into most of them now) to inspect the data actually being sent from your browser in the page request.
If it turns out that the fields really aren't being sent across at all, the problem is almost certainly in your form. For example, you might be closing it early, or there might be HTML errors that confuse the browser. Make sure that all of your input tags are between the <form>
and </form>
, and if they are then try an HTML validator to check your code. There are lots of options online, and even the inspectors built into browsers can often help you spot these sorts of issues.
answered Nov 12 at 14:52
Greg Schmidt
2,5551725
2,5551725
add a comment |
add a comment |
up vote
0
down vote
This is the most common problem:
If you check debug($this->request->getData());
before $spirit = $this->Spirits->newEntity();
you then see all submitted data!
Next go to Spirit Entity and double check if your fields "spirit_type_id,.." accessible!
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'*' => true, // quick fix
'id' => false,
];
or better way:
protected $_accessible = [
'spirit_type_id' => true,
'country_id' => true,
// etc ...
];
Edit
debug
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
debug($spirit); exit();
see if any errors.
Where I've got my debug statement currently is perfectly adequate to see all submitted data. I've also gone through my SpiritEntity and confirmed that all of these fields are accessible. Although that shouldn't play a part in where my issue is, the data just isn't being sent from the form period.
– Arak Tai'Roth
Nov 9 at 16:48
debug$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
– Salines
Nov 9 at 16:53
no errors on debugging
– Arak Tai'Roth
Nov 10 at 9:13
add a comment |
up vote
0
down vote
This is the most common problem:
If you check debug($this->request->getData());
before $spirit = $this->Spirits->newEntity();
you then see all submitted data!
Next go to Spirit Entity and double check if your fields "spirit_type_id,.." accessible!
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'*' => true, // quick fix
'id' => false,
];
or better way:
protected $_accessible = [
'spirit_type_id' => true,
'country_id' => true,
// etc ...
];
Edit
debug
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
debug($spirit); exit();
see if any errors.
Where I've got my debug statement currently is perfectly adequate to see all submitted data. I've also gone through my SpiritEntity and confirmed that all of these fields are accessible. Although that shouldn't play a part in where my issue is, the data just isn't being sent from the form period.
– Arak Tai'Roth
Nov 9 at 16:48
debug$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
– Salines
Nov 9 at 16:53
no errors on debugging
– Arak Tai'Roth
Nov 10 at 9:13
add a comment |
up vote
0
down vote
up vote
0
down vote
This is the most common problem:
If you check debug($this->request->getData());
before $spirit = $this->Spirits->newEntity();
you then see all submitted data!
Next go to Spirit Entity and double check if your fields "spirit_type_id,.." accessible!
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'*' => true, // quick fix
'id' => false,
];
or better way:
protected $_accessible = [
'spirit_type_id' => true,
'country_id' => true,
// etc ...
];
Edit
debug
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
debug($spirit); exit();
see if any errors.
This is the most common problem:
If you check debug($this->request->getData());
before $spirit = $this->Spirits->newEntity();
you then see all submitted data!
Next go to Spirit Entity and double check if your fields "spirit_type_id,.." accessible!
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array
*/
protected $_accessible = [
'*' => true, // quick fix
'id' => false,
];
or better way:
protected $_accessible = [
'spirit_type_id' => true,
'country_id' => true,
// etc ...
];
Edit
debug
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
debug($spirit); exit();
see if any errors.
edited Nov 9 at 16:57
answered Nov 9 at 16:35
Salines
2,95931134
2,95931134
Where I've got my debug statement currently is perfectly adequate to see all submitted data. I've also gone through my SpiritEntity and confirmed that all of these fields are accessible. Although that shouldn't play a part in where my issue is, the data just isn't being sent from the form period.
– Arak Tai'Roth
Nov 9 at 16:48
debug$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
– Salines
Nov 9 at 16:53
no errors on debugging
– Arak Tai'Roth
Nov 10 at 9:13
add a comment |
Where I've got my debug statement currently is perfectly adequate to see all submitted data. I've also gone through my SpiritEntity and confirmed that all of these fields are accessible. Although that shouldn't play a part in where my issue is, the data just isn't being sent from the form period.
– Arak Tai'Roth
Nov 9 at 16:48
debug$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
– Salines
Nov 9 at 16:53
no errors on debugging
– Arak Tai'Roth
Nov 10 at 9:13
Where I've got my debug statement currently is perfectly adequate to see all submitted data. I've also gone through my SpiritEntity and confirmed that all of these fields are accessible. Although that shouldn't play a part in where my issue is, the data just isn't being sent from the form period.
– Arak Tai'Roth
Nov 9 at 16:48
Where I've got my debug statement currently is perfectly adequate to see all submitted data. I've also gone through my SpiritEntity and confirmed that all of these fields are accessible. Although that shouldn't play a part in where my issue is, the data just isn't being sent from the form period.
– Arak Tai'Roth
Nov 9 at 16:48
debug
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
– Salines
Nov 9 at 16:53
debug
$spirit = $this->Spirits->patchEntity($spirit, $this->request->getData());
– Salines
Nov 9 at 16:53
no errors on debugging
– Arak Tai'Roth
Nov 10 at 9:13
no errors on debugging
– Arak Tai'Roth
Nov 10 at 9:13
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53219505%2fform-elements-not-being-submitted%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
No chance you did something silly like close the form before you output those fields? They look fine. Check your browser console to look at exactly what data is being posted, to narrow down whether it's not being sent from the browser vs being lost somehow on the server side?
– Greg Schmidt
Nov 9 at 6:02
@GregSchmidt Yes the data being sent in the headers is the same as the data being displayed in the debug output. I've gone over the form and it's not being closed prematurely.
– Arak Tai'Roth
Nov 9 at 16:47
Well, the problem is pretty obviously in your form, I guess. Check the HTML of the page with a validator service to see if there's some problem? Even the DOM inspector built into most browsers might be able to show you. Or, if you can post the URL, people could look at it.
– Greg Schmidt
Nov 9 at 17:18
@GregSchmidt No errors using the W3C Validator. I have no URL to share, this is entirely on localhost for the time being.
– Arak Tai'Roth
Nov 10 at 9:21
@GregSchmidt Despite there being no errors, you were indeed correct. I had a couple custom form elements that I was using, and one of them was for select buttons. I was copying and pasting the original form elements and then just modifying them, but apparently I modified the name attribute out of it, and that's what did it. If you want to offer yours as an answer, I would be happy to accept it.
– Arak Tai'Roth
Nov 10 at 22:05