Welcome Guest, Not a member yet? Register   Sign In
how to set default value in form input -only for Add-
#1

how i can add a default value in input form field which user trying Add data. if field is empty this should fill with default value otherwise show the saved value. currently i need it for a dropdown list. for some reasone, have 3 forms on a single table which are specific for their uses.
like a customer specific form to add a Customer it should contain user_type = "customer" 
if want to add a Rider it should contain user_type = "rider" 
same requirement in case where i want to restrict on other types of fields like a text, number, date, checkbox etc. 
please, if possible, have link(s) for different types of solution(s).
regards
Newbie here in CodeIgniter World !! Please appologize if any nonsense from me.  
environment: Windows 10, XAMPP 3.3.0, VS Code, SQLyog Community Ed. 
Reply
#2

Please read:

PHP NET - Ternary Operator - Example #3 Assigning a default value
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

See https://codeigniter.com/user_guide/helpe...#set_value
Reply




Theme © iAndrew 2016 - Forum software by © MyBB