Wednesday, 27 October 2010

Progress

I've created a set of forms, which will act as boxes where the user will input the data to then be read and put into the story when a button is pressed.

<form name="text_name">
<input type ="text" name="textbox1" size="20" maxLength="30" value="Name" />
</form>
<form name="text_animal">
<input type="text" name="textbox2" size="20" maxLength="30" value="Favourite Animal" />
</form>
<form name="text_sport">
<input type="text" name="textbox3" size="20" maxLength="30" value="Favourite Sport" />
</form>
<form name="text_food">
<input type="text" name="textbox4" size="20" maxLength="30" value="Favourite Food" />
</form>
<form name="text_eat">
<input type="text" name="textbox5" size="20" maxLength="30" value="A word for eating" />
</form>

Then there will be this code which will work to replace the IDs within the story, to put the information placed inside the forms, into the IDs that it is linked to.

<form name="text_emotion">
<input type="text" name="textbox6" size="20" maxLength="30" value="An emotion" />
</form>
<script type="text/javascript">
    document.writeln(text_name + "decided to go for a walk with their" + text_animal + ", hoping to find a good location to play some " + text_sport + ". Unfortunately their " + text_animal + " became hungry, so it was given a " + text_food + " to " + text_eat + "  on for the journey.");
    document.writeln("The day passed and " + text_name + " did not find somewhere to play " + text_sport + ", so they felt very " + text_emotion + " and decided to head off back home.");
</script>

No comments:

Post a Comment