Jump to content

s_avinash_s

Members
  • Posts

    121
  • Joined

  • Last visited

Everything posted by s_avinash_s

  1. Hi Thanks for the reply.I can able to get the font size. Isit possible to get the value received in "demo2", to use in other div or form . i mean like same value received in demo2 to be used for other part of code. How can i do it?
  2. Hi Am getting the value by using document.getElementById("demo2").innerHTML=this.responseText; My requirements are: 1.The receiving data from server should have different font size. I tried using document.getElementById("demo2").style.fontsize="25px"; But i didnt see change in size. 2.The value received in "demo2", i need to use in other part of code.I mean other form and div. How can i do it?
  3. Hi Now am successfully able to get it. if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; } else { document.getElementById("ping1").innerHTML = "Connected"; } Disconnected and connected , i need to change color. How can i do that
  4. Hi Now I keptonchange="showForm1()" only to Selkect Unit case and removed to other cases. This am not getting how to do it. I am not understanding it. Please share any example
  5. Hi I have checked the brackets and changed long back but still nothing is happening. <p id="ping1"> <button type="button" onclick="ping()">Change Content</button> </p> <script> function ping() { var xhttp = new XMLHttpRequest(); xhhtp.onreadystatechange = function() { if(xhttp.readyState == 4) { if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; } else { document.getElementById("ping1").innerHTML = "Connected"; } } }; xhttp.open("GET", "ping.txt", true); xhttp.send(); } </script>
  6. Hi I used as suggested by Funce var v = document.forms["myForm"]["USUnits"].value; if (v == "") { alert("SMass flow unit selection must be selected"); return false; } In this case when i select SI units or US units, They are not showing other drop down list. I can only see first drop down list not second one. Attached are the images. "Actual" image is what i needed.i .e first image "not working case" image is not expanding(second image)
  7. Hi Dsonesuk and Ingolme. 1. My board has a server type which accepts GET and POST requests and Web page acts as client. I did not get what do you mean by card server. 2.I tried like a below code.when i press the button nothing appears <p id="ping1"> <button type="button" onclick="ping()">Change Content</button> </p> <script> function ping() { var xhttp = new XMLHttpRequest(); xhhtp.onreadystatechange = function() { if(xhttp.readyState == 4) { if(xhttp.status == 0) { document.getElementById("ping1").innerHTML = "Disconnected"; } else { document.getElementById("ping1").innerHTML = "Connected"; } } xhttp.open("GET", "ping.txt", true); xhttp.send(); } </script>
  8. Hi Unable to connect comes when i disconnect the cable from board and refresh the page. But what my requirement is, When i disconnect the cable and don't refresh the page also.It should dis[play as disconnect or cannot connect
  9. Hi My requirement is to check from a web page if the server on the board is accessible or not. If it is accessible, I need to display on my web page as "connected " else "disconnected." How can i do this. Is there a way to use xhttp.open("GET", "online_check.txt", true); and setinterval to check every 1 second. If i get a data from server, display as connected else as disconnected. Is it possible. Please suggest
  10. Hi I can able to alert the user whenever the text box is empty. But i also need user to select dropdown list,m if not selected i need to alert to select. How can i do it. Please find my code . <div id="MassFlowRate" class="tabcontent2"> <br><br> <form action="/massflow.txt" id="myForm" name="myForm" method="post" autocomplete="off" onsubmit="return massflow(event)" > <label for="MassFlowUnitSelection">Mass Flow Unit Selection</label> <br> <select id='opts' name='Selectunit' onchange="showForm1()"> <option value="-1">Select Option</option> <option value="0">SI units</option> <option value="20">US units</option> </select> <div id="f1" style="display:none"> <select id='opt1' name='SIunits' onchange="showForm1()"> <option >Select Option</option> <option value="0">G/Sec</option> <option value="1">G/min</option> <option value="2">G/hr</option> <option value="3">G/day</option> </select> </div> <div id="f2" style="display:none"> <select id='opt2' name='USUnits' onchange="showForm1()"> <option >Select Option</option> <option value="0">Lbs/Sec</option> <option value="1">Lbs/min</option> </select> </div> <div> <label for="MassFlowDamping">Mass Flow Damping</label> <input type="text" id="MassFlowDamping" name="jq"> </div> <div> <label for="MassFlowCutoff">Mass Flow Cutoff</label> <input type="text" id="useracc" name="jjq"> </div> <div> <label for="MassLinenumber">Mass Line number</label> <input type="text" id="MassLinenumber" name="jqq"> </div> <div> <label for="MassDecimalPlaces">Mass Decimal Places</label> <input type="text" id="MassDecimalPlaces" name="ojq"> </div> <input type="submit" value="Submit!"> </form> <script> function massflow(e) { var w = document.forms["myForm"]["jq"].value; var x = document.forms["myForm"]["jjq"].value; var y = document.forms["myForm"]["jqq"].value; var z = document.forms["myForm"]["ojq"].value; if (w == "") { alert("1Name must be filled out"); return false; } if (x == "") { alert("2Name must be filled out"); return false; } if (y == "") { alert("3Name must be filled out"); return false; } if (z == "") { alert("4Name must be filled out"); return false; } e.preventDefault(); var myForm = document.getElementById('myForm'); formData = new FormData(myForm); var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("myForm").innerHTML = this.responseText; } }; xhttp.open("POST", "ind",true); xhttp.send(formData); return true; } function showForm1() { var selopt = document.getElementById("opts").value; if (selopt == 0) { document.getElementById("f1").style.display = "block"; document.getElementById("f2").style.display = "none"; <!--document.getElementById("opt2").disabled = true;--> } if (selopt == 20) { document.getElementById("f2").style.display = "block"; document.getElementById("f1").style.display = "none"; <!--document.getElementById("opt1").disabled = true;--> } if (selopt == -1) { document.getElementById("f2").style.display = "none"; document.getElementById("f1").style.display = "none"; } } function myFunction() { document.getElementById("myForm").addEventListener("submit", function(submit){ submit.preventDefault() }); } Please suggest how to proceed
  11. Can you share some example for this?
  12. s_avinash_s

    graph

    Hi Is it possible to get a simialr image to speedometer or a graph and updates the speedometer or graph image based on the value received
  13. i didnt get..any example is available
  14. HI I tried like below: body { background: lightblue; height: 60vh; width: 60vw; margin: 20vh 20vw; } But still getting full screen of background color I try to modify it here https://www.w3schools.com/code/tryit.asp?filename=FVCO9L8U59J4
  15. Hi Am working on web server. I need a background color not on the full page.but only 60% of my screen and to be in the middle. So that i can add my tabs on that 60% of the page Please help
  16. Hi I need to get a data only once using xhttp.open("GET", "url",true); But i dont have any button, only when the server and client are running at first, only first it should get a data and later should not.
  17. Hi In web server , how can i display whether server and client are connected or disconnected? Actually every 5 seconds , i need to check if server and client are connected .If connected i should display connected else disconnected How can i do it Thanks and Regards Avinash
  18. Hi 1.Cleared everything and checked,. same issue 2.tried pointing like below xhttp.open("POST", "ind",true); just a empty folder in sd card, but i dont receive anything in my code as it searches for resource /ind and cant found it
  19. Hi 1.Its nothing related to document title.But its related to only "/". I mean when it is "ip/" it points to ip/index.htm. 2. If i use xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); or if don't use above line of code. I get the following : '-----------------------------1168277922115 Content-Disposition:_form-data;_name' => string '"jq" 1 -----------------------------1168277922115 Content-Disposition: form-data; name="jjq" 2 -----------------------------1168277922115 Content-Disposition: form-data; name="jqq" 3 -----------------------------1168277922115 Content-Disposition: form-data; name="ojq" 4 -----------------------------1168277922115--
  20. I have captured a log from client to server. More over , i am sending a query to synergy also. Both are not same
  21. Hi I tried with php code and it has same behavior. /languages with submit form also goes to other page.
  22. Hi 1. With the below change of code, It goes to resource = /index.htm xhttp.open("POST", "/", true); And it does not take from <form action="/massflow.txt" id="myForm" name="myForm" method="post" autocomplete="off" onsubmit="return massflow(event)" > Because whenever it is "/" OR "#"it goes to index.htm from the code. From second argument only it is taking a resource and not from "action".
  23. HI Now am working with below code. <div id="MassFlowRate" class="tabcontent2"> <br><br> <form action="/massflow.txt" id="myForm" method="post" autocomplete="off" onsubmit="massflow(event)"> <div> <label for="MassFlowDamping">Mass Flow Damping</label> <input type="text" id="MassFlowDamping" name="jq"> </div> <div> <label for="MassFlowCutoff">Mass Flow Cutoff</label> <input type="text" id="useracc" name="jjq"> </div> <div> <label for="MassLinenumber">Mass Line number</label> <input type="text" id="MassLinenumber" name="jqq"> </div> <div> <label for="MassDecimalPlaces">Mass Decimal Places</label> <input type="text" id="MassDecimalPlaces" name="ojq"> </div> <input type="submit" value="Submit!"> </form> <script> function massflow(e) { e.preventDefault(); var myForm = document.getElementById('myForm'); formData = new FormData(myForm); var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("myForm").innerHTML = this.responseText; } }; xhttp.open("POST", "massflow.txt"); xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xhttp.send(formData); } } Whatever i enter in the text boxes, i receive the values correctly .Please check the log below. the values 5 4 3 and 12 i enter in text boxes and receive it on server. After that it shows "Thread #1 1 (single core) (Suspended : Signal : SIGBUS:Bus error) "and crashes.Whether its a server side issue or client side cant understand. resource =/massflow.txt request_type =2 g_post_data =-----------------------------169263147123299 Content-Disposition: form-data; name="jq" 5 -----------------------------169263147123299 Content-Disposition: form-data; name="jjq" 4 -----------------------------169263147123299 Content-Disposition: form-data; name="jqq" 3 -----------------------------169263147123299 Content-Disposition: form-data; name="ojq" 12 -----------------------------169263147123299-- If i remove below line of code e.preventDefault(); Then it works perfectly.no crashing. But it goes to other page , that is what not needed. How to proceed
  24. HI request.open("POST", "http://foo.com/submitform.php"); request.open("POST", "submitform.php"); oReq.open("POST", "stash.php", true); In the website mentioned has 3 types open...third one is same as mine i have will tried with xhttp.open("POST", "exam.txt"); xhttp.send(formData); But still it is same.. My log: resource =/exam.txt request_type =post whatever is second argument, that one it is taking as resource. Am getting a crash , not understanding whats the cause Please help , i need to forward this to customer today
  25. Hi Then i can pass resource in action of form Then can you suggest me what i should pass it as second argument in xhttp.open xhttp.open("POST", "exam.txt", true);
×
×
  • Create New...