Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16-03-2009
Member
 
Join Date: May 2008
Posts: 962
Problem with the parameters of JavaScript function

I have a text field that contains an IP address that the user types. When I press send, I send the correct command, the problem is that the browser load the stubbornly old IP. What I want to do is refresh the page by getting what the user types into the text field. I created a function to refresh the page but I can not pass a parameter in there in the field.

Here is my code:

HTML Code:
<HTML> <HEAD> 
<title>Changing the ip</title>
<style type="text/css"> 
body, td, th {
font-family: Verdana, Arial, Helvetica, sans-serif; 
font-size: 12px; 
color: #666666; 
}
</style> 
<script type="text/javascript"> 
var ip; 
var a; 
function Jump (ip){

location.href = ip; 
}
</script> 
</head> 

<blockquote> 
<p>&nbsp;</p>
<p> Network Settings </p> <hr> <br> 
<div align="center"> 
<table width="44%" border="1" cellpadding="4" cellspacing="1" bordercolor="#808080" bgcolor="#808080"> 
<tr> 
<td colspan="2" bgcolor="#800080"> 
<table width="100%" border="0" cellspacing="0" cellpadding="4"> 
<tr> 
<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #666666" width="145">
<b><font color="#FFFFFF">IP Address<br>Ex:000.000.000.000</font></b></td>
<td style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #666666">
<form method=get action="get_data" target="_blank"> 
<body> Enter Text Here: 
<input type="text" name="arg1"> 
<input type="submit" value="Calibrate" onclick="setTimeout('Jump(form.arg1.value)',3000)"> 

</body> 
</form> </td> 
</tr> 
</table> </td> 
</tr> 
</table> </div> 
</body> 
</blockquote> 

</html>
There must be something I do not see. If someone could help me.
Reply With Quote
  #2  
Old 16-03-2009
Member
 
Join Date: May 2008
Posts: 611
Re: Problem with the parameters of JavaScript function

form.arg1.value

I too feel you missed a getDocument or something important.
Reply With Quote
  #3  
Old 16-03-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: Problem with the parameters of JavaScript function

Quote:
var ip;
var a;
What is variable "a" in your code? Why is it declared unnecessarily?
Reply With Quote
  #4  
Old 16-03-2009
Member
 
Join Date: May 2008
Posts: 962
Re: Problem with the parameters of JavaScript function

The HTML is generated by frontpage, I started in HTML, or is what I have to save getDocument?
Reply With Quote
  #5  
Old 16-03-2009
XSI XSI is offline
Member
 
Join Date: May 2008
Posts: 271
Re: Problem with the parameters of JavaScript function

Even be a beginner, all starting from scratch, and do a good html/css before embarking on the javascript.

So, I'll say that without using software like FrontPage; code by hand, which is the best school.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem with the parameters of JavaScript function"
Thread Thread Starter Forum Replies Last Post
Problem when calling a Javascript function Truster Software Development 5 21-07-2010 11:37 PM
c# function equivalent to gettime function in javascript Omaar Software Development 4 10-03-2010 10:44 PM
How to pass function with parameters to another function in PHP? Linoo Software Development 5 27-02-2010 07:52 PM
JavaScript Sleep Function DARIELLE Software Development 3 29-06-2009 09:30 AM
JavaScript function help suseman Software Development 3 26-05-2009 05:11 AM


All times are GMT +5.5. The time now is 03:22 AM.