PDA

View Full Version : Making form buttons appear on the same line


cat_evilness
12-09-2002, 08:15 PM
Hey I need the code below edited so that the form buttons appear in the same line. The problem is I need each of the buttons to appear in different forms because they are all suppose to submit to different pages. Thanks for your help
Cat :thumbsup:

<form action="feed.html" target="virtualpet">
<input type="submit" value="Feed" onclick="hmm()">
</form>
<form action="play.html" target="virtualpet">
<input type="submit" value="Play" onclick="hmm2()">
</form>
<form action="medicine.html" target="virtualpet">
<input type="submit" value="Medicine" onclick="hmm3()">
</form>
<form action="exercise.html" target="virtualpet">
<input type="submit" value="Exercise" onclick="hmm4()">
</form>
<form action="sleep.html" target="virtualpet">
<input type="submit" value="Bed" onclick="hmm5()"><br>
</form>

beetle
12-09-2002, 08:53 PM
Well, that's not really a javascript question, now is it? :D

CSS should let you do this with the following, simple rule, placed in your stylesheetform {
margin: 0;
display: inline;
}However, there is a javascript solution to your problem.<form action="feed.html" target="virtualpet">
<input type="submit" value="Feed" onclick="this.form.action='feed.html';hmm()">
<input type="submit" value="Play" onclick="this.form.action='play.html';hmm2()">
<input type="submit" value="Medicine" onclick="this.form.action='medicine.html';hmm3()">
<input type="submit" value="Exercise" onclick="this.form.action='exercise.html';hmm4()">
<input type="submit" value="Bed" onclick="this.form.action='sleep.html';hmm5()"><br>
</form>What are all the hmm functions doing, anyways?