HTML - Updating Textbox Without Refreshing Page
I've got a user interface written in html, with various parameters for iperf in various textboxes. When the submit button is pressed, I call a .php file which takes the parameters and passes them to a java programme which runs iperf.
Using a form action pointing to the .php file, I can call the .php file and get the output (the data collected by iperf) to be printed to the screen, it just isn't in real time and refreshes the page completely. How would I redirect this output to a textbox on the original page? I was thinking about calling a javascript function upon submission of the form which would start an XMLHttprequest, but can't seem to get this to work... Current code which doesn't seem to do anything: Code: <head> <script language="javascript" type="text/javascript"> function ajaxFunction() { var ajaxRequest try { ajaxRequest = new XMLHttpRequest(); } catch (e) { try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { return false } } ajaxRequest.onreadystatechange = function() { if (ajaxRequest.readystate == 4) { this.iperfClientParameters.results.value = ajaxRequest.responseText; } }; ajaxRequest.open("GET","iperfRunningFile.php",true) ajaxRequest.send(null); } </script> </head> <body> <form name="iperfClientParameters" onSubmit="return ajaxFuntion()" method="get"> //form contents </form> </body> Thanks in advance for any responses. Similar TutorialsI need an HTML code to refresh a certain page every few seconds for a specified time. Example: Refresh a page every 5 seconds for 15 minutes then it stops. Hi, I have converted an jsp page to an html page using a C# program. The whole purpose of this practice was to change the old boring look of our video wall page display. The page colors on the jsp page are green, yellow and red showing the status of the monitored data center resources. I extracted this info from the old jsp page and created a new HTML page with a totally new look but with the same colors. But the problem now is the HTML page does not refresh the colors accordingly. I don't know why. Every 5 minutes the C# program is scheduled to run and read the jsp page and creates a new file in HTML which is use as the new display. Please help me out any advise i can get, i have tried my best but now i'm seeking advise from other people. Thanks Eric Hello. I'm putting together my first website, and trying to learn HTML basics. One specific problem I'm having is getting an image hyperlink to refresh my web page, rather than opening a new browser tab/window. For example, the code I'm using is... <a href="http://mywebsite.com" target="_blank"><img src="http://mywebsite.com/image.jpg" border="0" alt="My website"></a> When a visiter clicks on the image, a new browser tab/window opens. I want the page to refresh, instead. Can someone provide me with a solution? Thank you. Ello I'm a complete newb so sorry if I'm posting in the wrong place guys. Could anybody out there help me make a field / box like the one on this site. http://www.laptopsdirect.co.uk/Acer_...62/version.asp Below the laptop is a large field, if you click things like "technical specification" etc, it changes only that field. Then if you press the back button it backs up to the last page, rather than the last configuration of the current page. Phew.. confusing myself now lol. Anyhoo, just want to know how I would make such a box, with tabs that change that box only? Thanx Sarah hi i am new to this forum but wish anyone can help me as soon as possible as i am in hurry i have a value that is associated with the page http://1028634246.n126908.test.prosi...uk/Order.html? Productid='N60 - 400 Major Service Kit' i want this value to be assigned to text box to be displayed in this as default value of this textbox what is the code to achieve this? can i use jave script if so how ,what is the code is the page need to have asp extension? wish any one can reply me and help me as soon as possible thanks Hey there, I started html/css a few days since I wanted to make my own website for my own Minecraft server and I've ran into a little problem with it. I tried putting 2 videos aswell as a paragraph of text on the front page and well... the video at the bottom of the page was well below the white line. Is there something that I need to do so the page updates and expands? My html and css is below. HTML Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Dawn Craft</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <style type="text/css"> body { background-color: #000000; background-image: url(); } body,td,th { color: #FFF; } </style> </head> <body> <div id="header"><a href="index.html"><img src="images/header.png" width="900" height="100" /></a> <div id="menu"><a href="index.html"><img src="images/Home.png" width="80" height="25" /></a><a href="http://www.dawncraftmc.com/"><img src="images/Forum.png" width="80" height="25" /></a></div> </div> <div id="content_wrap"> <div id="left_content"> <div id="information" style="text-align: center; font-family: Verdana, Geneva, sans-serif; font-weight: bold;"> <p>Server updates</p> <p>----------------------------</p> <p>Congratulations to ICOZANE1 and 450airsoft on becoming the first 2 moderator's.</p> <p>----------------------------</p> <p>The server is being upgraded to 26 slots!</p> <p>----------------------------</p> <p>We got a new site! We will be keeping the forum.</p> <p> </p> <p> </p> <p> </p> <p>Vote for the server! <a href="http://www.xtremetop100.com/in.php?site=1132322674"> <img src="http://www.xtremeTop100.com/votenew.jpg" border="0" alt="Minecraft"></a></p> <p> </p> <p> </p> <p> </p> </div> </div> <div id="right_content"> <p> </p> <p style="text-align: center">A quick look at the 1.7 pistons update.</p> <div class="video_wrap2"> <iframe width="640" height="390" src="http://www.youtube.com/embed/uZJr86d2IUo" frameborder="0" allowfullscreen></iframe></iframe> </div> <p style="text-align: center"> </p> <p style="text-align: center"> </p> <p style="text-align: center"> </p> <p style="text-align: center">---------------------------------------------------------------------------------------------------------------------</p> <p style="text-align: center">The Server will be staying at 1.6 until all the mods are updated! Keep checking the site or the forums for updates. </p> </div> </div> <div id="footer" style="text-align: center"> <a href="http://minecraftviewer.com/servers/38428/view" target="_blank"><img src="http://cache.multiplayuk.com/b/1-38428-560x95.png" alt="Server Banner" style="border:0;width:560px;height:95" /></a> </div> </body> </html> Code: @charset "utf-8"; /* CSS Document */ body { margin:0;} #header { height:90px; width:855px; margin-left:auto; margin-right:auto; } #menu { height:45px; width:500px; margin-top:5px; margin-left:auto; margin-right:auto; font-family: District; border-bottom-width: 0px; border-bottom-style: none; border-bottom-color: #FFF; } #content_wrap { height:800px; width:980px; margin-left:auto; margin-right:auto; margin-top:10px; border: 3px solid #FFF; -moz-border-radius:20px; -webkit-border-radius:15px; background-color: #000; } #left_content { height:800px; width:240px; float: left; background-color: #000; border-top-color: #CCC; border-right-color: #CCC; border-bottom-color: #CCC; border-left-color: #CCC; } #information { height:719px; width:220px; margin-top:70px; margin-left:5px; -moz-border-radius:20px; -webkit-border-radius:15px; border: 3px solid #FFF; } #right_content { height:800px; width:730px; margin-left:10px; float: right; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-color: #F00; border-right-color: #F00; border-bottom-color: #F00; border-left-color: #F00; } .video_wrap2 { height:390px; width:640px; margin-left:auto; margin-right:auto; margin-top:30; } #footer { height:25px; width:980px; margin-left:auto; margin-right:auto; margin-top:10px; } Hi I have written a gallery where a user can upload a photograph. This uses a form to upload the photo, and insert data into a MySQL table. What I want to do, is instead of having to go through the submit button, have a button where the user can click, this will upload the image, create a thumbnail, display the thumbnail on the page - but the page is not refreshed........... Can this be done with AJAX? Bearing in mind, I have little/no experience with Javascript - but I'm willing to learn! If this can be done, and it's using AJAX, are there tutorials out there to which I could be directed? Many thanks S I've been developing a few webpages using frames and I've encountered a small disadvantage with it. When you refresh from a random link using frames, you go back to the index/homepage again. Is there any possible solution to stick to the page you were on previously even though you refresh the page? Thanks a lot in advance for any help Well, here's the gig. I'm using a select tag such as (I've dimmed it down so it is easier to follow): <select id="gameNumber" name="gameNum" onchange="update()"> <option value="1">Number 1</option> <option value="2">Number 1</option> </select> As you can see it is using the function "update()" when someone selects an option from the drop down list. The update function looks like this: <script type="text/javascript"> function update() { window.loction.reload; } </script> Now I want it to refresh another frame with the id "datascreen", not the current frame that it is in. I'm using vertical frames, the follow is the code: <frameset cols="25%, 75%" <frame noresize="noresize" src="admin.php" name="main"> <frame noresize="noresize" src="showdata.php" name="data" id="datascreen"> </frameset> Now, the select drop down menu is in the admin.php, and I want this action to refresh/reload showdata.php. Hopefully someone can help me with this. Thanks Chad. I just changed the logo for a site and now because the width and height dimensions are different from the old one the logo will look skewed to old customers coming to the site without refreshing their browsers. How do I solve this problem? I am using the body onload to open a new window but is it possible to check if the window is already open and if so to not refresh it as I am using it as a music player and hitting the home link starts it off again. Any suggestions and if so as much detail as possible would be greatly appreciated :-) Thanks, root. Alright, I'm new here and I'm sure I will require help a lot of time, so thank you guys in advance. Here's my first problem.. I'm making a website that doesn't take all the page, but just a rectangle in the middle of it. I want to use a background that will fit around that rectangle. Here, everything is okay. But I noticed a little thing that bugs it all : When I press on the Refresh Button, the rectangle suddenly moves to go a little bit on the top and on the left. I fear it will bug all my background when visitors will refresh. So here is the temporary website with a test background... http://www.freewebs.com/salp/versiontest.htm ...Get on it, press REFRESH, you will see, the rectangle moves just a little. Is there any way I could fix that up, or is anybody able to find out where the problem is, because I just can't figure it out. Table? Page? Flash? By myself, it's about the percentages used in the tables and the use of alignements, but I'm still not sure. Thank you! I have semi-protected my website (nothing important) by having a frameset, and a login page for the first visible page. However, if I'm somewhere in the website and I refresh the page, the browser refreshes the entire frameset and I'm back to the original login page (which is flash). Is there any way to redirect the refresh, so that once I'm in the website, only the frame with content refreshes? The frameset is *,100%, so I only want the 100% to refresh, see... Also, I'm working with XHTML for the first time, and I don't know much about it. Can anyone validate/verify this source code? Thanks! This is the entire frameset code: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-frameset.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- InstanceBegin template="/Templates/template2.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii" /> <title>xxx</title> </head> <frameset rows="*,100%"> <frame name="hidden" src="xxx.html" scrolling="no" frameborder="0" /> <frame name="visible" src="password.html" scrolling="auto" frameborder="0" /> <noframes><body /></noframes> </frameset> </html> Hello, I'm a moderator for an game site. We have a page on the site that reported posts dump in to for review. At home, I have a nifty greasemonkey script installed in Firefox that alerts me when a new report is there. At work, however, I'm forced to use IE. So, I figured I'd whip up a little something that would allow me to see new reported posts while browsing the rest of the site all in one browser window. I've tinkered, looked around the web, and just can't seem to get this to work. An extra set of eyes would be helpful. Here goes: ------------- index.htm ------------- <HTML><HEAD><TITLE>Keep focus</TITLE></HEAD> <FRAMESET ROWS="33%,67%" framespacing=0 border=0 frameborder="no"> <FRAME NAME="up" SRC=report.htm> <FRAME NAME="down" SRC=main.htm> </FRAMESET></HTML> ------------- report.htm ------------- <html> <head> <META HTTP-EQUIV="REFRESH" CONTENT="5; URL=http://goallineblitz.com/game/forum_reported_posts.pl"> </head> </body> </html> ------------- main.htm ------------- <html> <head> </head> <body> <a href="http://goallineblitz.com/game/home.pl">GLB</a> </body> -------------- I have a link in main.htm because it was trying to make me login in both frames. I'm a bit out of practice, so hoprfully I'm just missing something small and not looking totally foolish here. Any help appreciated. I have two frames that I am dealing with. Its a typical navigation and main content scenario. The frames point to the files nav.php and home.php. When you hit F5 or the refresh button the site reverts to its base state of nav and home. If you use the nav panel and visit another section eg contact.php it loads the new document into the main window, but when you hit refresh or F5 it reverts itself back to its base state using home.php. I do not wish to change the actual site too much, what I was hoping for is some variable that will only reload the current document in the main content frame rather than the entire site. Thus keeping contact.php in view. Is this possible? I have searched google and this forum but the only thing I can locate is people asking for target="url", but not my issue. Any input is appreciated. Cheers LiamMac did not realize this was also javascript too. Please help me on this one. http://www.htmlforums.com/php-progra...eld-87724.html how to make the page automatically grab the page's url and paste it into a textfield. thanks I have this page that can add textbox and remove it but the problem is if I add textbox they will all have the same name as the default. How can I have different name from my textbox so that I can call them individually on the next page...Thanks <html> <head> <script language="javascript"> row_no=1; function addRow(tbl,row) { var textbox='<td height="25" align="center" valign="middle" bgcolor="#EEEEEE"><input name="textfield5" type="text" class="bodytext" size="20"></td><td height="25" align="center" valign="middle" bgcolor="#EEEEEE"><input name="textfield6" type="text" class="bodytext" size="35"></td><td height="25" align="center" valign="middle" bgcolor="#EEEEEE"><input name="textfield7" type="text" class="bodytext" size="3"></td>'; var remove= '<a href="#" onclick="removeRow(\''+ tbl +'\',\'' + row_no + '\')"/>Remove It</a>'; var tbl = document.getElementById(tbl); var rowIndex = document.getElementById(row).value; try { var newRow = tbl.insertRow(row_no); var newCell = newRow.insertCell(0); var newCell = newRow.insertCell(1); newCell.innerHTML = textbox + " " + remove; row_no++; } catch (ex) { alert(ex); } } function removeRow(tbl,num) { var table = document.getElementById(tbl); try { row_no--; table.deleteRow(num); } catch (ex) { alert(ex); } } </script> </head> <body> <form name="form1" method="post" action=""> <table width="600" border="0" cellspacing="0" cellpadding="0" id="mytable"> <tr id="myrow"> <td colspan="2" align="center"><h3>Some Text goes here</h3> </td> </tr> <tr ID="add"> <td width="177"> </td> <td width="273" align="right"><input type="button" name="Button" value="Add a new row" onClick="addRow('mytable','myrow')"></td> </tr> <tr ID="add"> <td width="177"> </td> <td width="273" align="right"> </td> </tr> </table> </form> </body> </html> Hi, I am trying to work out a form i.e. user was to choose from a "Yes/No" drop-down option. For example if user was to choose "NO", nothing will happen, BUT if user was to choose "YES" option, a text box will appear next to the field to allow user to enter some information. Can this be done? My code is below. Thanks HTML Code: <tr> <td bgcolor="#eeeeff"> Is it a shared device?<br> <font color='#F62817'>** If yes, please indicate the shared device </font> </td> <td bgcolor="#eeeeff"> <SELECT name="shared"> <option value="No"SELECTED>No</option> <option value="Yes">Yes</option> <INPUT type = "TEXT" name = "shared_remark" value = "NIL"> </td></tr> Right...I'm in the process of creating a sample website, which takes in date data and number data...and I was wondering...as I have the option of using drop downs or textboxes....if the site does go onto a server...would it be easier (as the developer) to use drop downs or text inboxes..? I mean..when it comes to the user choosing things using the drop down or inputting into the textbox..and sending it to search in a database...which would be easier to play around with..and less complicated..? *thinks Am I making sense?* |