The facility is not available through IRCTC or on line. The is can be done through PRS counters only. Even in PRS counter only onward journey booking is possible. Onward journey is boarding the next train within 24 hours after getting down at intermediate station. For the example you have quoted, you have to contact the unreserved ticket supervisor, get a paper ticket and reserve through PRS counters for each leg of the journey.