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 Coder
    Join Date
    May 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving dynamically changed values JS

    I am building a kind of editor that reads a file and displays it in a nice GUI (input boxes and so on) but once javascript has changed some values in the boxes by using pop up clour menus and things how can i save that modificaiton. Because if i change the values, and then look at "view source" in the browser the values are still the same as before???

  • #2
    Regular Coder BonRouge's Avatar
    Join Date
    Mar 2006
    Location
    Sendai, Japan
    Posts
    328
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Get the Webdeveloper extension for Firefox and try View Source>View Generated Source. You can see the current values of elements that way.

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well im not really asking whether it is there or not (because i know it is, the values change) im really asking how you can save the modified value - pass it to another page with a reference to where it is supposed to go / a reference to which value it is suppose to replace?

    update: sorry i was being lazy and now i have just done a simple input box change with onclick:

    PHP Code:
    <?php
    if($_POST['submit']) {

        echo 
    $_POST['change'];
    }
    ?>

    <html>
    <head>
    <script type="text/javascript">
    function change() {
        document.getElementById('change').value='i have been changed';
    }
    </script>
    </head>

    <body>
    <form action="test.php" method="post">
    <input type="text" name="change" id="change" value="changeme"><br>
    <div onclick="return change();">Change</div>
    <input type="submit" name="submit">
    </form>
    </body>
    </html>
    even though the source says the original value when i post it reads the changed value. Sorry to have wasted time, delete this topic.
    Last edited by tbobker; 02-27-2007 at 12:32 AM.

  • #4
    Regular Coder BonRouge's Avatar
    Join Date
    Mar 2006
    Location
    Sendai, Japan
    Posts
    328
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have the values there, so yes, just send them via a form as post data and receive them with the server-side language of your choice and then (probably) put them into your database.


  •  

    Posting Permissions

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