0

Good evening to all,

I am having trouble creating a form which will update after user input. The page displays the current text, but I want to have the user to be able to input text into the form, click submit and overwrite the text with new input.

Currently I have:

 <div class="box">
   <h3 id="profile">Edit Profile</h3>

<form action="/update" method="POST">
  <fieldset>
    <div class="form-group">
      <label for="trainee[about]">About</label>
      <textarea>"<%= @profile["about"] %>" </textarea>
    </div>
    <div class="form-group">
      <label for="trainee[ambition]">Ambition</label>
      <textarea>"<%= @profile["ambition"] %>" </textarea>
    </div>
    <div class="form-group">
      <label for="trainee[learning_experience]">Learning Experience</label>
      <textarea>"<%= @profile["learning_experience"] %>" </textarea>
    </div>
    <div class="form-group">
      <label for="trainee[projects]">Projects</label>
      <textarea>"<%= @profile["projects"] %>" </textarea>
    </div>
    <div class="form-group">
      <label for="trainee[rationale]">Rationale</label>
      <textarea>"<%= @profile["rationale"] %>" </textarea>
    </div>
    <div class="form-group">
      <label for="trainee[codeacademy]">Code Academy Profile</label>
      <textarea>"<%= @profile["rationale"] %>" </textarea>
    </div>
      <input type="submit" value="Update Profile" />
  </fieldset>
</form>

The above gives me the space needed for the user to input and update their information, but when submit is clicked, the text is not updated.

Any help would be greatly appreciated.

Kwoochit
  • 27
  • 1
  • 3

0 Answers0