Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Adding textbox value into href image link

    Hello

    I have tried looking this up on the internet but i havent been able to find an exact answer.

    I would like the value from my text box to appear in the href link of a clickable image.
    The value from the textbox entry will be the IP address i want to browse to when clicking on the image.

    Here is my code so far;

    Code:
    <body>
    
    <table width="200" border="1">
      <tr>
        <td width="9">&nbsp;</td>
        <td width="104"><a href='index.php?ip='+form3.ip.value><img src="up.png" width="97" height="104" align="middle" /></a></td>
        <td width="65">&nbsp;</td>
      </tr>
    <td><form id="form3" name="form3" method="post" action="">
          <label for="ip"></label>
          <input name="ip" type="text" id="ip" value="192.168.0.2" />
        </form></td>
    When i click on the link it simply refreshes the current page and changes the url to localhost/index.php?ip=

    I also need this link not to open. In other words, once i have click on the image, i want to silently browse to the textbox value (ip address) in the background.

    All help would be appreciated. Im in mech engineering, and i need this to control a robot over wifi

    Thanks alot.

  • #2
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    okay i have figured out how to open a link from a textbox.

    Although i still dont know how to open a webpage silently without a window opening.
    Any ideas? thanks

  • #3
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    When you say "silently" are you referring to something like AJAX?

    You could "silently" visit the page that way (and just discard the result) if your only goal is to essentially "ping" the server (or your robot's IP).
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #4
    New to the CF scene
    Join Date
    Feb 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I want it to load up the webpage in the background without displaying anything.

    For example, the link will be 192.168.0.2/?forwards
    Where the forwards part will make the robot move forwards.
    I dont want to open a separate window every time i send a command to the robot.
    Im not sure if pinging the address would send the command. I could try though.
    How could this be implemented?
    thanks for the help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •