...
Usually, your routine will either have all client-side or all server-side steps. In other words, it is either a client-side routine or a server-side routine. However, sometimes it may make sense to mix the two types of steps. This For example, this would allow you to enforce client-side validation or to update client-side values before they are sent to the server.
...