#1
  1. Contributing User
    SEO Chat High Scholar (3500 - 3999 posts)

    Join Date
    Mar 2003
    Location
    Louisiana, USA
    Posts
    3,874
    Rep Power
    24

    JS question - submit and reset form at same time


    I need some javascript help. I am submitting a form (with just one field) to a separate frame. What I would like to see happen is that the data entered into the form field gets submitted to the frame, and then the form field is cleared out, waiting for the next data to be input. I can manage to get one or the other to happen, but not both. Any ideas?
  2. #2
  3. iTamer
    SEO Chat Discoverer (100 - 499 posts)

    Join Date
    Apr 2003
    Location
    Auckland, New Zealand
    Posts
    170
    Rep Power
    17
    rather than submitting the form just have something like this
    PHP Code:
    <script>
    function 
    dothis(fld)
    {
      
    window.frame2.location 'http://www.mysite.com/page.php?id=' fld.value;
       
    fld.value '';
    }
    </script>
    <input type='text' name='stuff' onblur='dothis(this);'> 
    all this does is manually update the location of the other frame with the new value, and then empty out the field again
    Last edited by sarahk; Oct 14th, 2003 at 05:36 AM.

IMN logo majestic logo threadwatch logo seochat tools logo