So I have been trying to make a Javascript alphabetizer and here is what i have so far:
<HTML>
<HEAD>
<TITLE>JavaScript Aphabetizer 2013 Science Fair</TITLE>
</HEAD>
<BODY>
2013 Science Fair JavaScript Alphabetizer
<FORM>
<TEXTAREA name="inputText" rows=5 cols=80 wrap=on></TEXTAREA>
<TEXTAREA name="outputText" rows=5 cols=80 wrap=on readonly></TEXTAREA>
</FORM>
</BODY>
</HTML>
I just dont understand where to put .split(), Array, .sort(), and .join(). I have read all of background information and all of chapter one at http://www.webteacher.com/javascript/index.html and I still dont get where to put them. In the form i know but in what order??
Plz help it's due on 3/5/13
Javascript alphabetizer FORM
Moderators: AmyCowen, kgudger, bfinio, MadelineB, Moderators
-
- Posts: 2
- Joined: Sat Mar 02, 2013 1:52 pm
- Occupation: Student: 7th grade
- Project Question: I am working on ABC's of Programming: Writing a Simple "Alphabetizer" which I use JavaScript to script an alphabetizer usable in browser.
- Project Due Date: 3/5/13
- Project Status: I am conducting my experiment
-
- Moderator
- Posts: 421
- Joined: Wed Sep 17, 2008 9:20 pm
- Occupation: electronic engineer
- Project Question: n/a
- Project Due Date: n/a
- Project Status: Not applicable
Re: Javascript alphabetizer FORM
Hi:
I think this link might help: http://www.javascriptkit.com/javatutors ... ort4.shtml
Let us know if this helps.
(Here's some code that might work):
Keith
I think this link might help: http://www.javascriptkit.com/javatutors ... ort4.shtml
Let us know if this helps.
(Here's some code that might work):
<script type="text/javascript">
function sortvalues(param){
var inputvalues=document.sorter.inputText.value.split(" ")
inputvalues.sort()
document.sorter.inputText.value=''
for (i=0;i<inputvalues.length-1;i++)
document.sorter.inputText.value=document.sorter.inputText.value+inputvalues+" "
document.sorter.inputText.value+=inputvalues[inputvalues.length-1]
}
</script>
<FORM name="sorter">
<TEXTAREA name="inputText" rows=5 cols=80 wrap=on></TEXTAREA><br>
<input type="button" value="Sort alphabetically" onClick="sortvalues(0)">
</FORM>
Keith
-
- Posts: 1
- Joined: Thu Feb 13, 2014 12:22 am
- Occupation: jhgjmhjnhbjn
- Project Question: nmkhgjhgjgh
- Project Due Date: 12365478
- Project Status: I am just starting
Re: Javascript alphabetizer FORM
I keep getting a message that I need to enable Javascript. Javascript is enabled. I have checked everything I possibly can. I have turned off my firewall and anti virus and still no luck. I have reinstalled the IE and nothing. Any help would be great.
__________________________
fashion police ~ fashion n you
__________________________
fashion police ~ fashion n you