I am trying to get the following code to work I believe it should work but i don't understand why it doesn't :(
I am trying to get it to take words that have been placed into the accepted dropdown box, and place a semi-colon at the end of each word, so that I have a delimited list of words.
Which I then wish to pass into to the URL, which would allow me to do the necessary processing on the words in my PHP scripts
my code looks like the following
Expand|Select|Wrap|Line Numbers
- function createLinks()
- {
- var Values = '';
- var selectBox = document.getElementById('acceptwords').options;
- for(var i=0; i<selectBox.length; i++) { // Loop through the options.
- Values += selectBox[i].value + ";"; // Concatenate the option values into the Value string.
- }
- Values=Values.replace(/;$/,""); // Trim the leading semi-colon.
- window.location="http://www.asite.com?words="+Values;
- }
[HTML]
<input type="button" value="Make Link" onClick="createLinks()">
[/HTML]
any help would be greatly appreciated
Boyindie