In answer to some queries on this topic, I have been assured that it is okay to write in a candidate from another party on your party's ballot. If you are a Republican for example, and wish to vote for a Democrat, simply write in the name in the appropriate space for that office ( be sure to not vote for more than allowed for each office) and fill in the oval next to " Write In."
The caveat is a big one. Your vote will not count in the other parties primary.
The votes on primary ballots are counted only within the party listed on the ballot.
Therefore a write-in vote in this circumstance will not affect who is elected as the
nominee of that candidate’s party. It will though provide a show of support for a candidate not in your party.