Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Help using a variable in the place of an address


Message #1 by "Tony Mobley" <tmobley@i...> on Thu, 12 Oct 2000 14:36:10 +0100
Don't use a traditional 'Submit' just a normal button that calls a function 
in its onclick event. eg customSubmit which sets the form.action property to 
server + whatever and then calls form.submit() method.

Joe



>From: "Tony Mobley" <tmobley@i...>
>Reply-To: "javascript" <javascript@p...>
>To: "javascript" <javascript@p...>
>Subject: [javascript] Help using a variable in the place of an address
>Date: Thu, 12 Oct 2000 14:53:23 -0700
>
>I am using javascript to declare my variable prod
>
>I am trying to use a switch that we can change prod to true or false
>depending on whether we are in development or production.  we have an
>address for development and one for production.
>
><script language="javascript">
>var prod
>prod = false
>function product(){
>	if (prod==false){
>		server = "https://agree.asp"
>
>	}
>	else{
>		server = "http://agree.asp"
>
>	}
>}
>
></script>
>
>
>Here I am setting the value according to the switch
>
><body bgcolor=#000000 text=#ffffff link=#ffff00 vlink=#ffff00 
>onload="product()" >
>
>
>Here is where I want to go to the next page according to the address in the 
>variable server
>
><FORM method='post' NAME='frmPartnersSignUp' action=server>
>
>Could you please help me.(ds)
>---
>NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?
>Visit EarthWeb for the latest in IT Management, Software Development,
>Web Development, Networking & Communications, and Hardware & Systems.
>Click on http://www.earthweb.com for FREE articles, tutorials,
>and discussions from the experts.
>---

  Return to Index