title: html / javascript: Prevent <input> value from clearing on form submit
body: <p>I have a form consisting of only one <code>&lt;input&gt;</code> element:</p>
  
  <pre><code>    &lt;form&gt;
              &lt;input
                      type="text"
                      name="webpage-activity-url"
                      placeholder="URL"
                      value="[value inserted by templating engine]"
              /&gt;
              &lt;button type="submit" class="button button-secondary" data-action="urlSubmit"&gt;
                      Submit
              &lt;/button&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>And I also have some javascript (in the form of coffeescript) which is called when the form is submitted:</p>
  
  <pre><code>    onURLSubmit: (e)-&gt;
              e.preventDefault()
              # console.log('urlSubmit')
              url =  @$el.find('input[name="webpage-activity-url"]').val()
              if _.trim(url) == ''
                      return false
              if url.indexOf('//') == -1
                      url = 'http://' + url
              unless @$el.find('iframe').length &gt; 0
                      iframe = $('&lt;iframe /&gt;').insertAfter(@$el.find('.instructor-ui-box').first())
              @setIframeSrc url
              @$el.find('input[name="webpage-activity-url"]').val('')
  </code></pre>
  
  <p>Here is the same function compiled to javascript, in case you are not familiar with coffeescript:</p>
  
  <pre><code>WebpageActivityLayout.prototype.onURLSubmit = function(e) {
    var iframe, url;
    e.preventDefault();
    url = this.$el.find('input[name="webpage-activity-url"]').val();
    if (_.trim(url) === '') {
      return false;
    }
    if (url.indexOf('//') === -1) {
      url = 'http://' + url;
    }
    if (!(this.$el.find('iframe').length &gt; 0)) {
      iframe = $('&lt;iframe /&gt;').insertAfter(this.$el.find('.instructor-ui-box').first());
    }
    this.setIframeSrc(url);
    return this.$el.find('input[name="webpage-activity-url"]').val('');
  };
  </code></pre>
  
  <p>Here is my problem: when the form is submitted, the value that the user enters into the <code>&lt;input&gt;</code> element of the form is cleared and returned to the value specified by the <code>placeholder</code> attribute of the input element. I would like to prevent this behavior. I tried stepping through the javascript function, and I noticed that the value of the input element is reset when the <code>onURLSubmit</code> function <em>returns</em>. So I don't really know how to prevent this through javascript.</p>