Click to See Complete Forum and Search --> : Will someone please make me a generator?


dewkissedrose27
08-03-2004, 02:14 PM
I want a kitty generator please

like you type in the name of your kitty, select the sex, and type in what it likes to do and type in a story thing about them, and then a pop-up window opens up with the kitty on it that has a print button!

dewkissedrose27
08-03-2004, 02:37 PM
soo... anyone?

starrwriter
08-03-2004, 07:00 PM
Originally posted by dewkissedrose27
I want a kitty generator please

Would you like fries with that? (Sorry, couldn't resist the temptation.)

Charles
08-03-2004, 07:11 PM
The SPCA sells kitty generatrors for about $20 US. They kick out about four at a time and you just keep the one you want.

steelersfan88
08-03-2004, 07:58 PM
Something like this might help:<html>
<head>
<script type="text/javascript">

function Kitty(i) {
this.name = prompt("Name for Kitty #"+i+"?","").toString();
this.sex = prompt("Sex for Kitty #"+i+"?","").toString();
this.about = prompt("About Kitty #"+i+"?","").toString();
this.todo = prompt("Hobbies of Kitty #"+i+"?","").toString();
}

var howMany = prompt("How many kitties?","1");
howMany = (/\D/.test(howMany)) ? 0 : howMany;

if(howMany == 0) {
alert("OK, no kitties.");
}

var kitties = new Array();
for(var i=0;i<howMany;i++) {
kitties[i] = new Kitty(i+1);
}

function showInfo(nom) {
var i = getName(nom);
if(i == -1) {
alert("Name not found!");
return false;
}

var nm = "Name: "+kitties[i].name;
var gndr = "Sex: "+kitties[i].sex;
var abt = "About: "+kitties[i].about;
var hbbs = "Hobbies: "+kitties[i].todo;
alert(nm+"\n"+gndr+"\n"+abt+"\n"+hbbs);
}

function getName(nm) {
for(var i=0;i<kitties.length;i++) {
if(kitties[i].name.toLowerCase() == nm) {
return i;
}
}
return (-1);
}

</script>
</head>
<body>
<form name="kitty" onsubmit="showInfo(nom.value.toLowerCase());nom.value='';nom.focus();return false;">
<fieldset style="width:200px;text-align:center;">
<legend>Kitty Search</legend>
<input type="text" name="nom">
<button type="submit">Find Kitty!</button>
</fieldset>
</form>
</body>
</html>Dr. Script

dewkissedrose27
08-04-2004, 10:23 AM
thanks everyone!

steelersfan88
08-04-2004, 10:24 AM
Did that work? If it is not what you need, I'm sure you could build off it.

Dr. Script