Jump to content

s_avinash_s

Members
  • Content count

    46
  • Joined

  • Last visited

Community Reputation

0 Neutral

About s_avinash_s

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. s_avinash_s

    get element by id value and font

    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. s_avinash_s

    get element by id value and font

    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. s_avinash_s

    check if server and client are connected

    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. s_avinash_s

    alert for dropdown list

    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. s_avinash_s

    check if server and client are connected

    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. s_avinash_s

    alert for dropdown list

    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. s_avinash_s

    check if server and client are connected

    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. s_avinash_s

    check if server and client are connected

    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. s_avinash_s

    check if server and client are connected

    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. s_avinash_s

    alert for dropdown list

    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. s_avinash_s

    graph

    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. s_avinash_s

    background color

    i didnt get..any example is available
  14. s_avinash_s

    background color

    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. s_avinash_s

    background color

    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
×