Wildbad has had a railway line since 1869, when the Enz Valley Railway was built to bring the rich and the powerful up from Pforzheim to the Wildbad spa. In the 1990s the German ex-monopolist railway DB wanted to shut this line down, but then it was leased by the regional transport authority AVG, who electrified and modernized the line and made it a part of the Karlsruhe S-Bahn system, starting in December 2002.

The S6 at Bad Wildbad station
Then they extended the line an additional 800 meters from the traditional railway station through the center of town to the Kurpark.

Going through Bad Wildbad on the S6
Some of the trains (trams, actually) from Bad Wildbad now go all the way to Karlsruhe, partly on traditional railroad tracks and partly on city tram tracks. And all of them go to Pforzheim, where you can change to a regional express going to Karlsruhe. (And then to an InterCityExpress going to Frankfurt, for example.)
My photos in this post are from 2006. I revised the text in 2019.
See also: Rossini in Wildbad.