Results 1 to 5 of 5

Thread: Problem with the parameters of JavaScript function

  1. #1
    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.

  2. #2
    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.

  3. #3
    Join Date
    May 2008
    Posts
    271

    Re: Problem with the parameters of JavaScript function

    var ip;
    var a;
    What is variable "a" in your code? Why is it declared unnecessarily?

  4. #4
    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?

  5. #5
    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.

Similar Threads

  1. Problem when calling a Javascript function
    By Truster in forum Software Development
    Replies: 5
    Last Post: 21-07-2010, 11:37 PM
  2. c# function equivalent to gettime function in javascript
    By Omaar in forum Software Development
    Replies: 4
    Last Post: 10-03-2010, 10:44 PM
  3. Replies: 5
    Last Post: 27-02-2010, 07:52 PM
  4. JavaScript Sleep Function
    By DARIELLE in forum Software Development
    Replies: 3
    Last Post: 29-06-2009, 09:30 AM
  5. JavaScript function help
    By suseman in forum Software Development
    Replies: 3
    Last Post: 26-05-2009, 05:11 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,707,919.91779 seconds with 17 queries