мой друг дал мне задание.Вот в чем дело:
У меня есть 2 формы: когда вы отправляете первую, данные будут сохранены в классе, появится вторая форма, а когда вы нажмете на второй номер, он перенаправит вас на другойсайт, где все данные будут отображаться с использованием foreach с многомерным массивом.
Первая форма, вторая похожа:
form id="signupForm">
<fieldset>
<legend>Sign-up Form</legend>
<p>
<label for="firstname">First name</label>
<input id="firstname" name="firstname" type="text">
</p>
<p>
<label for="lastname">Last name</label>
<input id="lastname" name="lastname" type="text">
</p>
<p>
<label for="email">Email</label>
<input id="email" name="email" type="email">
</p>
<p>
<label for="confirm_email">Confirm Email</label>
<input id="confirm_email" name="confirm_email" type="email">
</p>
<p>
<label for="agree">Please agree to our policy</label>
<input id="checkbox" class="checkbox" name="agree" type="checkbox">
</p>
<button type="submit">submit</button>
</fieldset>
А вот JS с комментариями:
$( "#signupForm" ).submit(function( event ) {
event.preventDefault();
$( "#signupForm2" ).show( "slow" );
$( "#signupForm" ).hide( "fast" );
});
class Person {
var data = [];
var step;
function constructor(){
this.step = 1;
}
function changeStep(){
this.step++;
}
function store() {
// Find all inputs and text areas in current step
// Foreach all of them and save one by one into array
// Store array as step into data
// Call change step function
}
function getData(){
//Get data from var data array
}
}
Я буду счастлив залюбая помощьСпасибо.