update form validation |
Situação resolvida, coloquei o código PHP que faz a verificação e aponta o selected para o value correto no inicio da página. Antes estava logo acima do select.
Agradeço a atenção (05-28-2020, 04:59 PM)wdeda Wrote:(05-28-2020, 01:52 PM)rafapirapo Wrote:(05-28-2020, 08:02 AM)wdeda Boa tarde, segue a imagem tentando explicar Wrote:(05-27-2020, 06:57 PM)rafapirapo Wrote: hello, I have a problem with select options, it is necessary that when entering the edit page, bring the selected item as it appears in the database, when the post is executed if there are validations errors return to the edit page but with the select option selected according to last choice of the user, example when entering the database the option FORD the user changes to VW and submits the form and does not pass the validation of other fields must return to the edition form with the selected VW option.---- MODEL Rafael, a questão é que o campo SIM/NÃO é um drop/down, ou seja, quando o usuário chega a essa tela o status dele é não quando ele deixa de preencher o campo obrigatório ele volta ao estado normal, eu entedo o que você deseja. Por exemplo em um formulário sem drop/down os campos já preenchidos quando uma campo obrigatório não é preenchido, são exibidos com as informações registradas pelo usuário. Pode ser que haja algum tipo de "macete" que permita isso, vou colocar em inglês e ver se alguém conhece. The image attached by @rafapirapo is duplicated, before and after. It is a form for changing user data. The form header is: "ALTERAR DADOS DO USUÁRIO". Below, on the right, there is a drop/down, "ATIVO - STATUS" and option 1 is "NÃO(no)". Still below, but now on the left, there is a field "USUÁRIO (User)" that is required, he would like that if the user chose the drop/down 2 "SIM(yes)" and did not fill in the required field when the form was displayed again to the user for fill in the required field, option 2, already marked by the user, "SIM(yes)", was kept. His code Model Code: public function updaterecord($data) Controller: Code: public function update($id = NULL) View: Code: <div class="form-group col-md-3 cb"> |
Messages In This Thread |
update form validation - by rafapirapo - 05-27-2020, 06:57 PM
RE: update form validation - by nmaa3003 - 05-28-2020, 04:13 AM
RE: update form validation - by wdeda - 05-28-2020, 08:02 AM
RE: update form validation - by rafapirapo - 05-28-2020, 01:52 PM
RE: update form validation - by wdeda - 05-28-2020, 04:59 PM
RE: update form validation - by rafapirapo - 05-28-2020, 05:35 PM
RE: update form validation - by wdeda - 05-29-2020, 05:07 AM
RE: update form validation [RESOLVED] - by rafapirapo - 05-29-2020, 06:58 PM
RE: update form validation - by cukikt0302 - 05-28-2020, 10:12 AM
RE: update form validation - by InsiteFX - 05-29-2020, 03:18 AM
|