User Tools

Site Tools


en:web_development:forms:javascript

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:web_development:forms:javascript [2022/01/27 07:24]
mag
en:web_development:forms:javascript [2023/08/16 09:33] (current)
Line 734: Line 734:
 <code>    var status = document.getElementById('status'); <code>    var status = document.getElementById('status');
     if (message == "") {     if (message == "") {
-        document.getElementsByName('add_hero').submit();+        document.getElementsByName('add_hero')[0].submit();
     } else {     } else {
         status.firstElementChild.innerHTML = message;         status.firstElementChild.innerHTML = message;
Line 917: Line 917:
   * Save, upload and test that everything works as it should.   * Save, upload and test that everything works as it should.
   * If it does, the final step is to add the commands to submit each form.   * If it does, the final step is to add the commands to submit each form.
-<code>        document.getElementsByName('add_appearance').submit();</code> +<code>        document.getElementsByName('add_appearance')[0].submit();</code> 
-<code>        document.getElementsByName('delete_appearance').submit();</code>+<code>        document.getElementsByName('add_appearance')[0].submit();</code>
   * Save, upload and test again.   * Save, upload and test again.
   * Congratulations. You have now created a functional form.   * Congratulations. You have now created a functional form.
  
 [[en:web_development:forms:exercises|Next: Exercises]] [[en:web_development:forms:exercises|Next: Exercises]]
en/web_development/forms/javascript.1643297061.txt.gz · Last modified: 2023/08/16 09:33 (external edit)