comaiwat
03-13-2009, 04:08 PM
Hello everyone,
I have a .php file serving on my website in it sits a JavaScript that I copy and paste from javascriptkit.com
The only things that this script is calling is the form name which is search_form and the select tag name which is category and onload the showtext() function.
I have been messing with this for a couple of days now since I'm neither a .pHP or javascript programmer. But I can decypher it relatively easy.
The problem is when I run the page in the browser it totally bombed with the current script below.
So, I started to do a trial and error run and removed functions, what I found out was if I removed the two functions (gothere and showtext) the webpage served up just fine, but of course the script didn't work.
Can someone take a quick peek below and see what is causing the bombed out page? I don't know if there is something between .php and JavaScript that might be of conflict with each other. Thaks in advance for looking.
<script language="JavaScript" type="text/javascript">
<!--
/*
Combo box with description credit-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free script here!
*/
var shortcut=document.search_form
var descriptions=new Array()
//extend this list if neccessary to accomodate more selections
descriptions[0]=""
descriptions[1]="Specializing in applications such as heating, air conditioning, pressure boosting, and wastewater systems."
descriptions[2]="Specializing in applications in boiler feed, clean in place (CIP), clean and wash, pressure boosting, machine tool, chemical feed, water treatment, wastewater and HVAC."
descriptions[3]="Specializing in applications such residential and light commercial hot water circulation, heating systems,cooling and air conditioning, and sewage and effluent."
descriptions[4]="Specializing in applications such as domestic water supply, pressure boosting, irrigation, de-watering and submersible "
shortcut.text.value=descriptions[shortcut.category.selectedIndex]
function gothere(){
location=shortcut.category.options[shortcut.category.selectedIndex].value
}
function showtext(){
shortcut.text.value=descriptions[shortcut.category.selectedIndex]
}
//-->
</script>
I have a .php file serving on my website in it sits a JavaScript that I copy and paste from javascriptkit.com
The only things that this script is calling is the form name which is search_form and the select tag name which is category and onload the showtext() function.
I have been messing with this for a couple of days now since I'm neither a .pHP or javascript programmer. But I can decypher it relatively easy.
The problem is when I run the page in the browser it totally bombed with the current script below.
So, I started to do a trial and error run and removed functions, what I found out was if I removed the two functions (gothere and showtext) the webpage served up just fine, but of course the script didn't work.
Can someone take a quick peek below and see what is causing the bombed out page? I don't know if there is something between .php and JavaScript that might be of conflict with each other. Thaks in advance for looking.
<script language="JavaScript" type="text/javascript">
<!--
/*
Combo box with description credit-
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free script here!
*/
var shortcut=document.search_form
var descriptions=new Array()
//extend this list if neccessary to accomodate more selections
descriptions[0]=""
descriptions[1]="Specializing in applications such as heating, air conditioning, pressure boosting, and wastewater systems."
descriptions[2]="Specializing in applications in boiler feed, clean in place (CIP), clean and wash, pressure boosting, machine tool, chemical feed, water treatment, wastewater and HVAC."
descriptions[3]="Specializing in applications such residential and light commercial hot water circulation, heating systems,cooling and air conditioning, and sewage and effluent."
descriptions[4]="Specializing in applications such as domestic water supply, pressure boosting, irrigation, de-watering and submersible "
shortcut.text.value=descriptions[shortcut.category.selectedIndex]
function gothere(){
location=shortcut.category.options[shortcut.category.selectedIndex].value
}
function showtext(){
shortcut.text.value=descriptions[shortcut.category.selectedIndex]
}
//-->
</script>