[website-critique] Need help with JavaScript programming.

  • From: "Eric C. Vogel" <EricCVogel@xxxxxxxxxxxx>
  • To: <websitecritique@xxxxxxxxxxxxx>
  • Date: Wed, 8 Aug 2001 10:26:56 -0400

I was able to find someone who provided me with the code I needed, but it 
doesn't quite do what I need it to do. I was wondering if anyone on here could 
correct it. I looked it over with my little knowlage of C I have had and cannot 
find the reason it is producing what it is.

The page the code is on is:
http://www.benefitservicesgroup.com/ebsg/client_access.htm

Enter jf for the company and it goes to:
http://www.benefitservicesgroup.com/ebsg/client_access.htm?company=jf
It should go to http://www.beenefitservicesgroup.com/ebsg/clients/jf

Here is the code that goes in the body:
<SCRIPT language=javascript> 
<!-- 
function getCompany(){ 
var company = document.myform.company.value; 
urlStr = "http://www.benefitservicesgroup.com/ebsg/clients/"; 
if(company!=""){ 
window.location.href=urlStr+company+".asp"} 
else{ 
alert("Please enter a company"); 
return false;} 
} 
//--> 
</SCRIPT> 

And in the main part:

<FORM name=myform> 
<INPUT type=text name=company value="" size="20"> 
<BR> 
Enter your company name 
<BR> 
<INPUT type=button value=Go onclick="getCompany()"> 
</FORM>
 
Thank you,
Eric Vogel



Please Forward This Email to a Friend 

~~~~~~~~~~~~~~~~~~~~~~
List Info: http://www.freelists.org/cgi-bin/webpage?webpage_id=websitecritique 
~~~~~~~~~~~~~~~~~~~~~~

Other related posts: