Jump to content

rizwansyed

Members
  • Posts

    72
  • Joined

  • Last visited

Posts posted by rizwansyed

  1. Hi 

    As you suggested i am able to submit the form with POST and url.am able to receive it on server side.

    But not getting any data.

    Submit is success but no data.I think submit is not getting any data.so it is submitting with no data.

    Attached is my modified source code.

    Please suggest how to get a data in submit 

    Thanks and Regards

    Rizwan Syed

    mass.txt

  2. Hi

    Whenever i click on submit button,It goes to other page in html and i need to press back button.

    I came to know that with AJAX, It is possible to avoid going to next page as it does in background.

    Can anyone please share a example for ajax submit form

    Please suggest

     

    Thanks and Regards

    Rizwan Syed

  3. Hi Dsonesuk,

    The above mentioned method is not working.I only get whatever data is available in file.Not henry ford.

    I forgot to tell i used GET method to get data continuously.

    Now am getting the dynamic data, thats fine.

    I have a input text box in my HTML page. What ever the dynamic data i receive is it possible to keep it in text box.

     

    Please suggest

     

  4. Hi

    Now it is able to read the data from my file ajax_info.txt.Only static data present in file am getting.

    So now how can i get updated value from my board.

    DO i need to write  it continuously   to ajax_info.txt  or any other way to do it.

  5. Hi Dsonesuk,

    Actually form usage i have checked with html.it works fine.

    With Ajax am trying to use setInterval("loadDoc()", 1000); as shown in attached figure.

    Every 1 sec, i can able to see the data receiving at POST request on board side ( checked through breakpoint).

     

    Now in sd card i have kept a file "ajax_info.txt" with some static data in it.But am not getting any data.

     

    atest.txt

  6. Hi

    am able to run using XAMPP on PC.

    When i run from my board, am not getting proper data.

    I mean it is not fetching the file index_1.txt.html and index_1.txt file are available in same path in sd card.

    Anything wrong

     

    Instead of using second argument with file name, is it possible to use as a function and call it in same file in below code

    xhttp.open("POST", "index_1.txt", true);

    Please suggest

     

    Thanks and Regards

    Rizwan Syed

  7. Hi

    1.am able to run using XAMPP on PC.

    When i run from my board, am not getting proper data.

    I mean it is not fetching the file index_1.txt.html and index_1.txt file are available in same path in sd card.

    Anything wrong

     

    2.Instead of using second argument with file name, is it possible to use as a function and call it in same file in below code

    xhttp.open("POST", "index_1.txt", true);

    Please suggest

     

    Thanks and Regards

    Rizwan Syed

  8. Hi

    1.Now am able to run using XAMPP on PC.

     

    2.Instead of using second argument with file name, is it possible to use as a function and call it in same file in below code

    xhttp.open("POST", "index_1.txt", true);

     

    3.When i run from my board, am not getting proper data.

    I mean it is not fetching the file index_1.txt.html and index_1.txt file are available in same path in sd card.

    Anything wrong

    Please suggest

     

    Thanks and Regards

    Rizwan Syed

  9. Hi

    I have loaded the same file on my PC 

    xhttp.open("POST", "index_1.txt", true);

    and i have index_1.txt file in my same folder as html file.

    When i press the button , am not getting the content present in index_1.txt file

     

    Please suggest

  10. Hi

    My board can access post requests.

    By seeing above link, it has  "xhttp.open(\"GET\", \"ajax_info.txt\", true);"

    Do it need a file for taking a data.

    How does it work

    Actually my code will be searching a delimiter and then replace the text or value corresponding to it.

    I may not be using any other file

  11. Hi

    Am trying to execute basic example from w3schools, but am only getting 

    "Getting server updates " print and nothing else.

    I have kept my two files.index.html and "demo_sse.php" in same folder and trying to load html file.

    demo_sse.php :

    <?php
    header('Content-Type: text/event-stream');
    header('Cache-Control: no-cache');
    $time = date('r');
    echo "data: The server time is: {$time}\n\n";
    flush();
    ?>

     

    index.html:

    <!DOCTYPE html>
    <html>
    <body>

    <h1>Getting server updates</h1>
    <div id="result"></div>

    <script>
    if(typeof(EventSource) !== "undefined") {
        var source = new EventSource("demo_sse.php");
        source.onmessage = function(event) {
            document.getElementById("result").innerHTML += event.data + "<br>";
        };
    } else {
        document.getElementById("result").innerHTML = "Sorry, your browser does not support server-sent events...";
    }
    </script>

    </body>
    </html>

     

    Please suggest any mistake am doing here

     

    Thanks and Regards

    Rizwan Syed

  12. Hi Dsonesuk,

    Thanks for the Reply .It may not work as this again similar to refreshing to get the value.

    Is It possible to do with HTML.

    Please suggest

     

  13. Hi Dsonesuk,

    I have a S7G2-DK MCU board which interacts with HTML file loaded from SD card.

    As mentioned above the code below has a delimiter "$$$". The code inside delimiters will be searched and replaced with a particular text or value.

    var fxn = function() {
        document.getElementById('time').innerHTML = "$$$ABC1$$$";
    }

    "$$$ABC1$$$"  is one delimiter. Similarly it counts the number of delimiters in the html file  and updates the values based on our values assigning to replace the delimiter on html file .

    The problem am facing is, whenever i refresh my web page only that particular time, the value gets updated else it will be a constant.

    But i need whenever there is change in value,it should get updated without refreshing my web page.

     

    This is my requirement and am not getting exactly how to solve this

    Please suggest

    Thanks and Regards

    Rizwan Syed

     

     

  14. Hi Funce,

    Thanks for the reply.

     

    Actually My requirement is, I need to reload only a portion of the page like only the updating value to my html page .

    Its like updating time where only seconds are updating and other part is constant.

    Similar way i need to update all the values which changes dynamically every 1 second.

    In the above post, i tried the code which i have posted, it updates only once whenever i refresh and not continuous.

    Without refreshing i should be able to update the values .

     

    Thanks and Regards

    Rizwan Syed

  15. Hi

    I have  a sample code for dynamic update of value every 1 sec.

    <script>
    var count = 100;
    var fxn = function() {
        count++;
        document.getElementById('time').innerHTML = count;
    }
    setInterval(fxn, 1000);
    </script>

    <div id=time></div>

     

    As in above example, i need to display dynamic values  every second .

    So i tried to modify my code as below.

    <br>
    <input style="border:none;font-size:18pt;"  type="text"  name="$$$undefinedA1$$$" size="10" >
    <script>
    var fxn = function() {
        document.getElementById('time').innerHTML = "$$$ABC1$$$";
    }

    setInterval(fxn, 1000);
    </script>
    <div id=time>
    </div>

     

    In above code , i will receive the value from my board in "$$$ABC1$$$". So i should be able to update the value continuously on web browser apge.

    I tried above code but doesnot work.Please suggest how to proceed.

     

  16. Thanks for the reply.

    I didnt get exactly what u mean to say but i tried 

                            <form action="/action_page.php" method="post" autocomplete="off" onsubmit="Validate()">
    with two script files but didnt get it work.

     

    Can you just explain once again

  17. Hi

    I have a code in which i am running a script for drop-down list to show only the selected drop-down content as shown in attached file.

    I need to add one more script file for alerting a warning for unselected  drop-down list as shown below

    <input type="submit" value="submit" onclick="return Validate()" />
    <script >
        function Validate() {
            var abc = document.getElementById("opts");
            if (abc.value == "") {
                //If the "Please Select" option is selected display error.
                alert("Please select an option!");
                return false;
            }
            return true;
        }
    </script>
     
    How can i merge two script files or anyway to call both files
     
    Please suggest
     
    Thanks and Regards
    Rizwan Syed

    adding one more script file.txt

×
×
  • Create New...