developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 13 years ago

Closed 13 years ago

#334 closed bug (fixed)

submited values of buttons are not always <item value="VALUE">

Reported by: tefnout Owned by:
Priority: normal Milestone: Jelix 1.0 RC1
Component: jelix:forms Version: 1.0 beta 3.1
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed:
Hosting Provider: Php version:

Description

On ie, submited values of buttons are their names and not their 'value' attribute. So, jForms.getData('*submitname*') gives different values depending the navigator.

a solution in jFormBase::initFormRequest adding another condition from line 110 to the final else :

}elseif($ctrl->type=='submit' && !array_key_exists($value,$ctrl->datasource->datas)){
		$cases=array_flip($ctrl->datasource->datas);
		$this->_container->datas[$name]=$cases[$value];
}else.....

Change History (4)

comment:1 Changed 13 years ago by tefnout

  • Summary changed from Internet Explorer : submited values of buttons are not <item value="VALUE"> to submited values of buttons are not always <item value="VALUE">

comment:2 Changed 13 years ago by tefnout

Sorry, this new code doesn't scratch if null value (not valuated button)..

}elseif($ctrl->type=='submit' && $value && !array_key_exists($value,$ctrl->datasource->datas)){
				$cases=array_flip($ctrl->datasource->datas);
				$this->_container->datas[$name]=$cases[$value];
}else....

comment:3 Changed 13 years ago by laurentj

  • Milestone set to Jelix 1.0 RC1

comment:4 Changed 13 years ago by laurentj

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in the trunk.

Your patch is not very good because datasources have not a datas property (except staticdatasource) : you should use getDatas() instead.

Note: See TracTickets for help on using tickets.