PDA

View Full Version : looking for a unique sort of script


angyl
07-02-2002, 09:02 PM
This may be extremely silly, but I am looking for a script that allows the user to input information into 4 different fields and then takes specific letters from each of those fields to create 2 new words. It's similar in concept that the "find you porn star name" shenanigans, but it's not that. Can anyone help me?

joh6nn
07-02-2002, 09:20 PM
sure. which letters do you want to be taken from which strings?

angyl
07-02-2002, 10:08 PM
4 entries:

the first 3 letters of the first entry
the first 2 letters of the second entry
which forms the first new word

the first 2 letters of the third entry
the first 3 letters of the fourth entry
which forms the second new word

thanks for you help

joh6nn
07-02-2002, 10:14 PM
<script>
function mixMish() {
var theForm = document.FormName;

var firstword, secondword;
firstword = theForm.box1.value.slice(0, 3) + theForm.box2.value.slice(0, 2);
secondword = theForm.box3.value.slice(0, 2) + theForm.box4.value.slice(0, 3);

theForm.boxForResults.value = firstword + ' ' + secondword;
}
</script>

<FORM NAME="FormName">
...
...
<INPUT TYPE="BUTTON" VALUE="Submit" OnClick="mixMish();">
</FORM>

angyl
07-02-2002, 11:11 PM
Wow! that was really fast. And it works great. Thanks so much! When I actually get it on my site I'll let you know and link to your homepage.