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
sekhar passamsekhar passam 

I have 3 fields on a vf page .now when ever if filled all 3 fields the vf page should be automatically submitted without clicking any buttion .

Name:---------;
Phone:---------:
city:-------------;
Whenever i select city the page should be  automatically submitted;
Note: I don't have any button on Vf pafe 
 
SandhyaSandhya (Salesforce Developers) 
Hi,

You can have a Javascript function to check everything you want has been set, and then if it has, submit the form:

Refer below link for sample code

https://stackoverflow.com/questions/17784936/submit-a-form-without-using-submit-button
 
Please mark it as solved if my reply was helpful, it will make it available
for others as a proper solution.

Best Regards,
​Sandhya
 
 
Bhargavi TunuguntlaBhargavi Tunuguntla
Hi sekhar,

You can use javascript function to check the fields and submit it without button click.The code below worked for me for your requirement.
<script type="text/javascript">
    function check()
    {
        alert('check');
        alert(document.getElementById('pageId:form1:Name').value);
      if(document.getElementById('pageId:form1:Name').value!='' && document.getElementById('pageId:form1:Gender').value!='' && document.getElementById('pageId:form1:DOB').value!='')
     {
              Submit();
     }
    }
    </script>
    <apex:form id="form1">
        <apex:actionFunction name="Submit" action="{!Submit}" id="Submit" />
    Name:<apex:inputText id="Name" value="{!Name}" onkeyup="check();"/>
   Gender: <apex:inputText id="Gender" value="{!Gender}" onkeyup="check();"/>
    DOB:<apex:inputText id="DOB" value="{!DOB}" onkeyup="check();"/>
    </apex:form>

Please check the code.Let us know if it was useful.

Thanks.