Hello,
I'm trying to add a new property to content class.
His name is validator_id
in the form i've add a select list who display name of other users and their id in values.
i think i've well declare this new property in the class.
and i've added new field in the table.
anyway, when i post the form, i only can find the first value of the select list.
i don't see what to do more ?
If anyone can help me , please.
			
			
									
						
										
						How to add a new property in class.content.inc.php ??
- Elijah Lofgren
 - Power Poster

 - Posts: 811
 - Joined: Mon Apr 24, 2006 1:01 am
 
Re: How to add a new property in class.content.inc.php ??
Maybe I'm misunderstanding you, but when a form is posted, only the selected value of a select list is sent by the browser. That would explain why you can only find the first value of the select list.Fido wrote: in the form i've add a select list who display name of other users and their id in values.
i think i've well declare this new property in the class.
and i've added new field in the table.
anyway, when i post the form, i only can find the first value of the select list.
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 
			
						Re: How to add a new property in class.content.inc.php ??
i select a different value in the select list before posting it.
here the code of the select :
and anyway i always have the "?" value in the next page, even if i select "toto" with value 2.
For testing i've commented the redirect function after saving in the DB and i've put a phpinfo(32) that display $_REQUEST = ?
it's very strange
			
			
									
						
										
						here the code of the select :
Code: Select all
$userlist = UserOperations::LoadUsers();
					if ($userlist && count($userlist) > 0){
						echo '<select name="validator_id"';
						echo '><option value="?">Select the validator</option>';
						foreach ($userlist as $oneuser)
						{
							if($oneuser->active == 1 && $oneuser->id != $userid){
								echo '<option value="'.$oneuser->id.'"';
								if($oneuser->id == $validator_id){
									echo ' selected="selected"';
								}
								echo '>'.$oneuser->username.'</option>';
							}
						}
						echo '</select>';
					}For testing i've commented the redirect function after saving in the DB and i've put a phpinfo(32) that display $_REQUEST = ?
it's very strange
Re: How to add a new property in class.content.inc.php ??
yes !
i've found !
I'm not understanding why, but it works.
In fact, i've added a line in "lib\contenttypes\Content.inc.php"
GenerateValidatorDropDown is a personal method that i've to user class
i guess that the POST data from form were parse again by or must be declare in that area ??
			
			
									
						
										
						i've found !
I'm not understanding why, but it works.
In fact, i've added a line in "lib\contenttypes\Content.inc.php"
Code: Select all
array_push($ret, array(lang('validator').':',UserOperations::GenerateValidatorDropdown('validator_id', $userid, $this->mValidatorId )));GenerateValidatorDropDown is a personal method that i've to user class
i guess that the POST data from form were parse again by or must be declare in that area ??
