Save web form with script

Is there a function for web form we can call to save? I want to trigger save button when a particular field is set.