function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Default value '0' should come in text box.(in visualforce page)

Hi all, 

I have a VF-Page for NewCollege, through this i am going to insert new college to some other database using API(not into custom or standard object), now my question is how can i give defalut value for a text box(if the text box is in some custom or standard object we can give while the field creation itself, but this field is from API,). so how can i give default value while declaring in visualforce page. 

and also after text box i want to show some text as shown in bellow screen. give me suggestion to achive it.

User-added image

Thanks in advance.
☯ BonY ☯☯ BonY ☯
Hi Venkyyy,

try this

In vf page you have to use html-placeholder.

object api = A_C_Holder__C
field Api = threshold__c

<apex:inputText value="{!A_C_Holder__c.threshold__c}" html-placeholder="30"/>

in apex cls.
A_C_Holder__C ac;
ac =(A_C_Holder__C)con.getRecord();  

if(ac.threshold__c == null)
      ac.threshold__c = '30';
      insert ac;