/    Sign up×
Community /Pin to ProfileBookmark

Adding additional fields to form.

Hello All,
I currently have this page http://rahmankhaliq.com/rsvp.html
What I am trying to do is have a guest choose yes or no, if they choose no, and click submit. I will get The answer no with their name to my email.

If they choose Yes, then I want a dropdown box to appear with numbers 1 though 10. If they choose 1, then a input box shows up so they can put the name of the guest. If they choose 2 then 2 input boxes show up, so on and so forth.

All fields should be required if they choose yes.
The submit should send me the results to my email…

Let me know your guys thoughts.
Thank you very much.

to post a comment
HTML

66 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumOct 04.2018 — I prepared something to start with. I left some todos, you might code these yourself.
<!DOCTYPE html>
<html lang="de">

<head>
<title>Dynamic form</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style>
#dynselect {
display: none;
}
#dyn2 label {
display: none;
}
</style>
</head>

<body>
<input type="radio" name="choice-animals" id="choice-animals-dogs" value="yes" required>
<label for="choice-animals-dogs">Yes, I would love to.</label>
<input type="radio" name="choice-animals" id="choice-animals-cats" value="no">
<label for="choice-animals-cats">No, Sorry I can't make it.</label>
<select id="dynselect">
<option value="">Please make your choice</option>
<option value="dyninput1">Opt 1</option>
<option value="dyninput2">Opt 2</option>
<option value="dyninput3">Opt 3</option>
</select>
<div id="dyn2">
<label for="dyninput1">
<input id="dyninput1" name="dyninput1" disabled>
Label for input 1
</label>
<label for="dyninput2">
<input id="dyninput2" name="dyninput2" disabled>
Label for input 2
</label>
<label for="dyninput3">
<input id="dyninput3" name="dyninput3" disabled>
Label for input 3
</label>
</div>
<script>
document.getElementById("choice-animals-dogs").addEventListener("click", function () {
document.getElementById("dynselect").style.display = "block";
// todo: set required for this select
});

<i> </i> // todo: hide select and remove required when "no" is clicked

<i> </i> document.getElementById("dynselect").addEventListener("change", function () {
<i> </i> var oldinput = document.querySelector("#dyn2 input[required]");
<i> </i> if (oldinput) {
<i> </i> oldinput.parentNode.style.display = "none";
<i> </i> oldinput.removeAttribute("required");
<i> </i> oldinput.setAttribute("disabled", true);
<i> </i> }
<i> </i> var vinput = document.getElementById(this.value);
<i> </i> vinput.parentNode.style.display = "block";
<i> </i> vinput.removeAttribute("disabled");
<i> </i> vinput.setAttribute("required", true);
<i> </i> });
<i> </i>&lt;/script&gt;
&lt;/body&gt;

&lt;/html&gt;
Copy linkTweet thisAlerts:
@soupiiauthorOct 04.2018 — Thank you, how do i make it so when opt 2 is clicked, then 2 options show up, and then if opt 3 is selected three text fields show up, and then if you chose NO, then they disappear, also the submit btn is gone.. thank you.
Copy linkTweet thisAlerts:
@SempervivumOct 04.2018 — how do i make it so when opt 2 is clicked, then 2 options show up, and then if opt 3 is selected three text fields show up[/quote]This can be done easily by using classes for making the elements visible and set the appropriate attributes:
&lt;!DOCTYPE html&gt;
&lt;html lang="de"&gt;

&lt;head&gt;
&lt;title&gt;Dynamic form&lt;/title&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;style&gt;
#dynselect {
display: none;
}
#dyn2 label {
display: none;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-dogs" value="yes" required&gt;
&lt;label for="choice-animals-dogs"&gt;Yes, I would love to.&lt;/label&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-cats" value="no"&gt;
&lt;label for="choice-animals-cats"&gt;No, Sorry I can't make it.&lt;/label&gt;
&lt;select id="dynselect"&gt;
&lt;option value=""&gt;Please make your choice&lt;/option&gt;
&lt;option value="foropt1"&gt;Opt 1&lt;/option&gt;
&lt;option value="foropt2"&gt;Opt 2&lt;/option&gt;
&lt;option value="foropt3"&gt;Opt 3&lt;/option&gt;
&lt;/select&gt;
&lt;div id="dyn2"&gt;
&lt;label for="dyninput1"&gt;
&lt;input class="foropt1 foropt2 foropt3" name="dyninput1" disabled&gt;
Label for input 1
&lt;/label&gt;
&lt;label for="dyninput2"&gt;
&lt;input class="foropt2 foropt3" name="dyninput2" disabled&gt;
Label for input 2
&lt;/label&gt;
&lt;label for="dyninput3"&gt;
&lt;input class="foropt3" name="dyninput3" disabled&gt;
Label for input 3
&lt;/label&gt;
&lt;/div&gt;
&lt;script&gt;
function setParams(sel, display, disabled, required) {
var inputs = document.querySelectorAll(sel);
for (var i = 0; i &lt; inputs.length; i++) {
var cinput = inputs[i];
cinput.parentNode.style.display = display;
cinput.removeAttribute(required);
cinput.setAttribute("disabled", disabled);

<i> </i> }
<i> </i> }
<i> </i> document.getElementById("choice-animals-dogs").addEventListener("click", function () {
<i> </i> document.getElementById("dynselect").style.display = "block";
<i> </i> // todo: set required for this select
<i> </i> });

<i> </i> // todo: hide select and remove required when "no" is clicked

<i> </i> document.getElementById("dynselect").addEventListener("change", function () {
<i> </i> setParams("#dyn2 input", "none", true, false);
<i> </i> setParams("#dyn2 input." + this.value, "block", false, true);
<i> </i> });
<i> </i>&lt;/script&gt;
&lt;/body&gt;

&lt;/html&gt;
if you chose NO, then they disappear, also the submit btn is gone[/quote]I left this to do for you. Have a look at my code, specifically the event listener for the first radio button and try to adapt it to the second one (no).
Copy linkTweet thisAlerts:
@soupiiauthorOct 05.2018 — Its not allowing me to, but you can find the code on rahmankhaliq.com/rsvp1.html The issue now is that it seems like I can't enter information in to the input fields, also the submit btn dosnt show up, there should be a submit btn regardless if they choose yes or no, and once clicked submit the results should be emailed to me...


What I have now

<!DOCTYPE html>

<html lang="de">

<head>

<title>Dynamic form</title>

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<style>

#dynselect {

display: none;

}

#dyn2 label {

display: none;

}

</style>

</head>

<body>

<input type="radio" name="choice-animals" id="choice-animals-dogs" value="yes" required>

<label for="choice-animals-dogs">Yes, I would love to.</label>

<input type="radio" name="choice-animals" id="choice-animals-cats" value="no">

<label for="choice-animals-cats">No, Sorry I can't make it.</label>

<select id="dynselect">

<option value="">How Many People Will Be Attending?</option>

<option value="foropt1">1 Person:</option>

<option value="foropt2">2 People:</option>

<option value="foropt3">3 People:</option>

<option value="foropt4">4 People:</option>

<option value="foropt5">5 People:</option>

<option value="foropt6">6 People:</option>

<option value="foropt7">7 People:</option>

<option value="foropt8">8 People:</option>

<option value="foropt9">9 People:</option>

<option value="foropt10">10 People:</option>

</select>

<div id="dyn2">

<label for="dyninput1">

Name of 1st Person:<input class="foropt1 foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput1" enabled>


</label>
<label for="dyninput2">
Name of 2nd Person: <input class="foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput2" enabled>

</label>
<label for="dyninput3">
Name of 3rd Person:<input class="foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput3" enabled>

</label>

<label for="dyninput4">

Name of 4th Person: <input class="foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput4" enabled>


</label>
<label for="dyninput5">

Name of 5th Person: <input class="foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput5" enabled>


</label>
<label for="dyninput6">

Name of 6th Person: <input class="foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput6" enabled>


</label>
<label for="dyninput7">

Name of 7th Person: <input class="foropt7 foropt8 foropt9 foropt10" name="dyninput7" enabled>


</label>
<label for="dyninput8">

Name of 8th Person: <input class="foropt8 foropt9 foropt10" name="dyninput8" enabled>


</label>
<label for="dyninput9">

Name of 9th Person: <input class="foropt9 foropt10" name="dyninput9" enabled>


</label>
<label for="dyninput10">

Name of 10th Person: <input class="foropt10" name="dyninput10" enabled>


</label>
</div>
<script>
function setParams(sel, display, disabled, required) {
var inputs = document.querySelectorAll(sel);
for (var i = 0; i < inputs.length; i++) {
var cinput = inputs[i];
cinput.parentNode.style.display = display;
cinput.removeAttribute(required);
cinput.setAttribute("disabled", disabled);

}
}
document.getElementById("choice-animals-dogs").addEventListener("click", function () {
document.getElementById("dynselect").style.display = "block";
// todo: set required for this select
});

// todo: hide select and remove required when "no" is clicked

document.getElementById("dynselect").addEventListener("change", function () {
setParams("#dyn2 input", "none", true, false);
setParams("#dyn2 input." + this.value, "block", false, true);
});

</script>

</body>

</html>
Copy linkTweet thisAlerts:
@SempervivumOct 05.2018 — Your code is displaying weird here. You should use code tags:

[ code]

your code here

[ /code]

(omit the spaces)
Copy linkTweet thisAlerts:
@SempervivumOct 05.2018 — The function I created was erroneous. Try this script:
&lt;script&gt;
document.getElementById("choice-animals-dogs").addEventListener("click", function () {
document.getElementById("dynselect").style.display = "block";
// todo: set required for this select
});

<i> </i> // todo: hide select and remove required when "no" is clicked

<i> </i> document.getElementById("dynselect").addEventListener("change", function () {
<i> </i> // create a list of all inputs
<i> </i> var inputs = document.querySelectorAll("#dyn2 input");
<i> </i> // loop through these inputs
<i> </i> for (var i = 0; i &lt; inputs.length; i++) {
<i> </i> // provide current input
<i> </i> var cinput = inputs[i];
<i> </i> // check if this input has class according
<i> </i> // value of the selected option
<i> </i> if (cinput.classList.contains(this.value)) {
<i> </i> // input should be enabled and visible
<i> </i> cinput.parentNode.style.display = "block";
<i> </i> cinput.setAttribute("required", true);
<i> </i> cinput.removeAttribute("disabled");
<i> </i> } else {
<i> </i> // input should be disabled and invisible
<i> </i> cinput.parentNode.style.display = "none";
<i> </i> cinput.removeAttribute("required");
<i> </i> cinput.setAttribute("disabled", true);

<i> </i> }

<i> </i> }
<i> </i> });
<i> </i>&lt;/script&gt;
Copy linkTweet thisAlerts:
@soupiiauthorOct 05.2018 — This makes more sense, so now I still dont see the submit btn that enters results to email as well as clicking no showing nothing just the submit btn. http://rahmankhaliq.com/rsvp1.html

this is what I have so far
<i>
</i>&lt;!DOCTYPE html&gt;
&lt;html lang="de"&gt;

&lt;head&gt;
&lt;title&gt;Dynamic form&lt;/title&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;style&gt;
#dynselect {
display: none;
}
#dyn2 label {
display: none;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-dogs" value="yes" required&gt;
&lt;label for="choice-animals-dogs"&gt;Yes, I would love to.&lt;/label&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-cats" value="no"&gt;
&lt;label for="choice-animals-cats"&gt;No, Sorry I can't make it.&lt;/label&gt;
&lt;select id="dynselect"&gt;
&lt;option value=""&gt;How Many People Will Be Attending?&lt;/option&gt;
&lt;option value="foropt1"&gt;1 Person:&lt;/option&gt;
&lt;option value="foropt2"&gt;2 People:&lt;/option&gt;
&lt;option value="foropt3"&gt;3 People:&lt;/option&gt;
&lt;option value="foropt4"&gt;4 People:&lt;/option&gt;
&lt;option value="foropt5"&gt;5 People:&lt;/option&gt;
&lt;option value="foropt6"&gt;6 People:&lt;/option&gt;
&lt;option value="foropt7"&gt;7 People:&lt;/option&gt;
&lt;option value="foropt8"&gt;8 People:&lt;/option&gt;
&lt;option value="foropt9"&gt;9 People:&lt;/option&gt;
&lt;option value="foropt10"&gt;10 People:&lt;/option&gt;
&lt;/select&gt;
&lt;div id="dyn2"&gt;
&lt;label for="dyninput1"&gt;
Name of 1st Person:&lt;input class="foropt1 foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput1" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput2"&gt;
<i> </i> Name of 2nd Person: &lt;input class="foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput2" enabled&gt;
<i> </i>
<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput3"&gt;
<i> </i> Name of 3rd Person:&lt;input class="foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput3" enabled&gt;
<i> </i>
<i> </i> &lt;/label&gt;
&lt;label for="dyninput4"&gt;
Name of 4th Person: &lt;input class="foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput4" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
&lt;label for="dyninput5"&gt;
Name of 5th Person: &lt;input class="foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput5" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
&lt;label for="dyninput6"&gt;
Name of 6th Person: &lt;input class="foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput6" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
&lt;label for="dyninput7"&gt;
Name of 7th Person: &lt;input class="foropt7 foropt8 foropt9 foropt10" name="dyninput7" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
&lt;label for="dyninput8"&gt;
Name of 8th Person: &lt;input class="foropt8 foropt9 foropt10" name="dyninput8" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
&lt;label for="dyninput9"&gt;
Name of 9th Person: &lt;input class="foropt9 foropt10" name="dyninput9" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
&lt;label for="dyninput10"&gt;
Name of 10th Person: &lt;input class="foropt10" name="dyninput10" enabled&gt;
<br/>
<i> </i> &lt;/label&gt;
<i> </i>&lt;/div&gt;
&lt;script&gt;
document.getElementById("choice-animals-dogs").addEventListener("click", function () {
document.getElementById("dynselect").style.display = "block";
// todo: set required for this select
});

<i> </i>// todo: hide select and remove required when "no" is clicked

<i> </i>document.getElementById("dynselect").addEventListener("change", function () {
<i> </i> // create a list of all inputs
<i> </i> var inputs = document.querySelectorAll("#dyn2 input");
<i> </i> // loop through these inputs
<i> </i> for (var i = 0; i &lt; inputs.length; i++) {
<i> </i> // provide current input
<i> </i> var cinput = inputs[i];
<i> </i> // check if this input has class according
<i> </i> // value of the selected option
<i> </i> if (cinput.classList.contains(this.value)) {
<i> </i> // input should be enabled and visible
<i> </i> cinput.parentNode.style.display = "block";
<i> </i> cinput.setAttribute("required", true);
<i> </i> cinput.removeAttribute("disabled");
<i> </i> } else {
<i> </i> // input should be disabled and invisible
<i> </i> cinput.parentNode.style.display = "none";
<i> </i> cinput.removeAttribute("required");
<i> </i> cinput.setAttribute("disabled", true);

<i> </i> }

<i> </i> }
<i> </i>});
&lt;/script&gt;
&lt;/body&gt;

&lt;/html&gt;
Copy linkTweet thisAlerts:
@soupiiauthorOct 07.2018 — any ideas guys?
Copy linkTweet thisAlerts:
@SempervivumOct 07.2018 — I assumed that you would be able to add the submit button and the click handler for the no button on your own.

This is the extended code:
&lt;!DOCTYPE html&gt;
&lt;html lang="de"&gt;

&lt;head&gt;
&lt;title&gt;Dynamic form&lt;/title&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;style&gt;
#dynselect {
display: none;
}
#dyn2 label {
display: none;
}
&lt;/style&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;form action="testpost.php" method="post"&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-dogs" value="yes" required&gt;
&lt;label for="choice-animals-dogs"&gt;Yes, I would love to.&lt;/label&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-cats" value="no"&gt;
&lt;label for="choice-animals-cats"&gt;No, Sorry I can't make it.&lt;/label&gt;
&lt;select id="dynselect"&gt;
&lt;option value=""&gt;How Many People Will Be Attending?&lt;/option&gt;
&lt;option value="foropt1"&gt;1 Person:&lt;/option&gt;
&lt;option value="foropt2"&gt;2 People:&lt;/option&gt;
&lt;option value="foropt3"&gt;3 People:&lt;/option&gt;
&lt;option value="foropt4"&gt;4 People:&lt;/option&gt;
&lt;option value="foropt5"&gt;5 People:&lt;/option&gt;
&lt;option value="foropt6"&gt;6 People:&lt;/option&gt;
&lt;option value="foropt7"&gt;7 People:&lt;/option&gt;
&lt;option value="foropt8"&gt;8 People:&lt;/option&gt;
&lt;option value="foropt9"&gt;9 People:&lt;/option&gt;
&lt;option value="foropt10"&gt;10 People:&lt;/option&gt;
&lt;/select&gt;
&lt;div id="dyn2"&gt;
&lt;label for="dyninput1"&gt;
Name of 1st Person:&lt;input class="foropt1 foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10"
name="dyninput1" enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput2"&gt;
<i> </i> Name of 2nd Person: &lt;input class="foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10"
<i> </i> name="dyninput2" enabled&gt;

<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput3"&gt;
<i> </i> Name of 3rd Person:&lt;input class="foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput3"
<i> </i> enabled&gt;

<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput4"&gt;
<i> </i> Name of 4th Person: &lt;input class="foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput4"
<i> </i> enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput5"&gt;
<i> </i> Name of 5th Person: &lt;input class="foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput5"
<i> </i> enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput6"&gt;
<i> </i> Name of 6th Person: &lt;input class="foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput6" enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput7"&gt;
<i> </i> Name of 7th Person: &lt;input class="foropt7 foropt8 foropt9 foropt10" name="dyninput7" enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput8"&gt;
<i> </i> Name of 8th Person: &lt;input class="foropt8 foropt9 foropt10" name="dyninput8" enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput9"&gt;
<i> </i> Name of 9th Person: &lt;input class="foropt9 foropt10" name="dyninput9" enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput10"&gt;
<i> </i> Name of 10th Person: &lt;input class="foropt10" name="dyninput10" enabled&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;/div&gt;
<i> </i> &lt;input type="submit"&gt;
<i> </i>&lt;/form&gt;

<i> </i>&lt;script&gt;
<i> </i> document.getElementById("choice-animals-dogs").addEventListener("click", function () {
<i> </i> sel = document.getElementById("dynselect");
<i> </i> sel.style.display = "block";
<i> </i> sel.selectedIndex = 0;
<i> </i> });
<i> </i> document.getElementById("choice-animals-cats").addEventListener("click", function () {
<i> </i> document.getElementById("dynselect").style.display = "none";
<i> </i> // create a list of all inputs
<i> </i> var inputs = document.querySelectorAll("#dyn2 input");
<i> </i> for (var i = 0; i &lt; inputs.length; i++) {
<i> </i> // provide current input
<i> </i> var cinput = inputs[i];
<i> </i> // input should be disabled and invisible
<i> </i> cinput.parentNode.style.display = "none";
<i> </i> cinput.removeAttribute("required");
<i> </i> cinput.setAttribute("disabled", true);
<i> </i> }
<i> </i> });


<i> </i> document.getElementById("dynselect").addEventListener("change", function () {
<i> </i> // create a list of all inputs
<i> </i> var inputs = document.querySelectorAll("#dyn2 input");
<i> </i> // loop through these inputs
<i> </i> for (var i = 0; i &lt; inputs.length; i++) {
<i> </i> // provide current input
<i> </i> var cinput = inputs[i];
<i> </i> // check if this input has class according
<i> </i> // value of the selected option
<i> </i> if (cinput.classList.contains(this.value)) {
<i> </i> // input should be enabled and visible
<i> </i> cinput.parentNode.style.display = "block";
<i> </i> cinput.setAttribute("required", true);
<i> </i> cinput.removeAttribute("disabled");
<i> </i> } else {
<i> </i> // input should be disabled and invisible
<i> </i> cinput.parentNode.style.display = "none";
<i> </i> cinput.removeAttribute("required");
<i> </i> cinput.setAttribute("disabled", true);

<i> </i> }

<i> </i> }
<i> </i> });
<i> </i>&lt;/script&gt;
&lt;/body&gt;

&lt;/html&gt;

The task to send an email is a bit more complex. I know a fine tutorial for a contact form which might be adapted easily to your task but unfortunately it's in german. Maybe another member knows a good newsletter script.
Copy linkTweet thisAlerts:
@soupiiauthorOct 08.2018 — Thank you so much, but how do I get the fields to erase, for example. if I choose two people and the names is Person1 and Person 2, but then I change it to one person, the field for person 2 dosn't get deleted. so If I chose 2people option the names are still saved.... Also Ijust need the results to be emailed.... nothing fancy.,, Also last question is if they choose No and click submit how can I have a message pop up saying "We will miss you" and if they choose yes and click submit a message will come saying "We are excited to see you"...


I appreciate it so much....
Copy linkTweet thisAlerts:
@rootOct 08.2018 — https://www.w3schools.com/jsref/met_form_reset.asp
Copy linkTweet thisAlerts:
@soupiiauthorOct 08.2018 — tht didnt work
Copy linkTweet thisAlerts:
@SempervivumOct 08.2018 — That does work, however there is a disadvantage: It will reset the complete form, including the radio buttons and the select. Both radio buttons unchecked, select is showing the first option "make a choice".
Copy linkTweet thisAlerts:
@rootOct 08.2018 — May I suggest that you just reload the page then...

location.roload( true ); // reload from the server
location.roload( false ); // reload from the cache
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — @Sempervivum#1596622 So I implemented this on my page, http://rahmankhaliq.com/contacts.html

but issue is why are the options showing up even if I havnt clicked on the radio btn, then it fixes when i choose each of the radio btn, also the input box fields looks invisiable, how do i fix that?

Thank you.
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — You forgot about the style:
&lt;style&gt;
#dynselect {
display: none;
}
#dyn2 label {
display: none;
}
&lt;/style&gt;
This will make the select and the inputs invisible initially.
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — Can you tell me how I can have the data that users inputted (names and sugesstions) when submit is clicked it will go to email [email protected]?
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — As I posted earlier, this is a bit more complex. I adjusted the newsletter script I mentioned earlier to your needs:

datacheck.php
&lt;?php
// add PHP Mailer
use PHPMailerPHPMailerPHPMailer;
require_once 'phpmailer/src/Exception.php';
require_once 'phpmailer/src/PHPMailer.php';
const HTML_ERROR_START = '&lt;div class="alert alert-danger" role="alert"&gt;&lt;p class="m-0"&gt;';
const HTML_ERROR_END = '&lt;/p&gt;&lt;/div&gt;';
const HTML_SUCCESS_START = '&lt;div class="alert alert-success" role="alert"&gt;&lt;p class="m-0"&gt;';
const HTML_SUCCESS_END = '&lt;/p&gt;&lt;/div&gt;';

$receiver = '[email protected]';
$emailfrom = '[email protected]';
$namefrom = 'Contact Form';
/**
* 1. Check if form was submitted.
*/
if (isset($_POST['submit'])) {
/**
* 2. Filter data
* - We use the function htmlspecialchars()
* - The function trim() is used to remove all empty spaces from start and end of the string
*/
$choice = htmlspecialchars(trim($_POST['choice-animals']));
$persons = [];
for ($i = 1; isset($_POST['dyninput' . $i]); $i++) {
$persons[] = htmlspecialchars(trim($_POST['dyninput' . $i]));
}

<i> </i>$errors = [];
<i> </i>$success = false;
<i> </i>$nr = 1;
<i> </i>foreach ($persons as $cperson) {
<i> </i> if (empty($cperson)) {
<i> </i> $errors[] = HTML_ERROR_START . 'Please enter a name for person no. ' . $nr . ' !' . HTML_ERROR_END;
<i> </i> $nr++;
<i> </i> }
<i> </i>}

<i> </i>// for testing only
<i> </i>if (empty($receiver)) {
<i> </i> $errors[] = HTML_ERROR_START . 'Please enter the email address of the receiver!' . HTML_ERROR_END;
<i> </i>}
<i> </i>/**
<i> </i> * 4. Check if there were errors, if not send email
<i> </i> * - for sending email we use PHPMailer
<i> </i> */
<i> </i>if (count($errors) === 0) {
<i> </i> $mailer = new PHPMailer();
<i> </i> $mailer-&gt;CharSet = 'UTF-8'; // Set charset setzen for correct display of special characters
<i> </i> $mailer-&gt;setFrom($emailfrom, $namefrom); // Set email address and name of sender
<i> </i> $mailer-&gt;addAddress($receiver); // Empfängeradresse
<i> </i> $mailer-&gt;isHTML(true);
<i> </i> $mailer-&gt;Subject = 'New message'; // Subject
<i> </i> $mailer-&gt;Body = '&lt;h3&gt;New message&lt;/h3&gt;
<i> </i> &lt;h3&gt;Choice was: ' . $choice . '&lt;/h3&gt;
<i> </i> &lt;h2&gt;Persons:&lt;/h2&gt;';
<i> </i> foreach ($persons as $cperson) {
<i> </i> $mailer-&gt;Body .= $cperson . '&lt;br&gt;';
<i> </i> }
<i> </i> /**
<i> </i> * Check if email was sent successfully
<i> </i> * if so: Report success
<i> </i> * if not: Report error(s)
<i> </i> */
<i> </i> if (!$mailer-&gt;send()) {
<i> </i> $errors[] = HTML_ERROR_START . 'An errror occured. Please try again in some minutes!' . HTML_ERROR_END;
<i> </i> } else {
<i> </i> $success = HTML_SUCCESS_START . 'Your Message was sent successfully!' . HTML_SUCCESS_END;
<i> </i> }
<i> </i>}
}
Place this code in a file named datacheck.php.

Rename your file contacts.html to contacts.php

Add this on top of contacts.php:
&lt;?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
require_once 'datacheck.php';
?&gt;

Add this belows your form in contacts.php:
&lt;?php
if (!empty($errors) &amp;&amp; count($errors) &gt; 0 &amp;&amp; !$success) {
echo implode('', $errors);
} else if (!empty($success) &amp;&amp; count($errors) === 0) {
echo $success;
}
?&gt;

The script makes use of the PHP mailer. Download it form here:

https://github.com/PHPMailer/PHPMailer

(use the green button "Clone or download" and "Download ZIP")

Unzip the file and put the contents into a folder named "phpmailer".

If this works so far, try to include the Family Name and the comments in the PHP script yourself.
Copy linkTweet thisAlerts:
@gamblewayOct 09.2018 — Hello Soupii,

You may be interested in Connectix that connect you in real time with experts.

Check it out ?

http://connectix.strikingly.com/
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — For my contacts.php I have this but the submit btn is erroring out.
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;Rahman | Khaliq | RSVP&lt;/title&gt;
&lt;meta charset="utf-8"&gt;
&lt;link rel="stylesheet" href="css/reset.css" type="text/css" media="all"&gt;
&lt;link rel="stylesheet" href="css/layout.css" type="text/css" media="all"&gt;
&lt;link rel="stylesheet" href="css/style.css" type="text/css" media="all"&gt;
&lt;script src="js/jquery-1.6.js" &gt;&lt;/script&gt;
&lt;script src="js/cufon-yui.js"&gt;&lt;/script&gt;
&lt;script src="js/cufon-replace.js"&gt;&lt;/script&gt;
&lt;script src="js/Josefin_Sans_400.font.js"&gt;&lt;/script&gt;
&lt;script src="js/Tangerine_700.font.js"&gt;&lt;/script&gt;
&lt;script src="js/atooltip.jquery.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery.nivo.slider.pack.js"&gt;&lt;/script&gt;
&lt;script src="js/script.js"&gt;&lt;/script&gt;
&lt;!--[if lt IE 9]&gt;
&lt;script src="js/html5.js"&gt;&lt;/script&gt;
&lt;style type="text/css"&gt;.aToolTip, .box1, .box1 .inner, .button, .button strong{behavior:url("js/PIE.htc");}&lt;/style&gt;

&lt;![endif]--&gt;
&lt;/head&gt;
&lt;body id="page6"&gt;
&lt;div class="body1"&gt;
&lt;div class="main"&gt;
&lt;!-- header --&gt;
&lt;header&gt;
&lt;div class="wrapper"&gt;
&lt;h1&gt;&lt;a href="index.html" id="logo"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;nav&gt;
&lt;ul id="menu"&gt;
&lt;li&gt;&lt;a href="guest.html"&gt;Venue/Accommodations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="guestbook.html"&gt;Guestbook&lt;/a&gt;&lt;/li&gt;
&lt;li class="first" id="menu_active"&gt;&lt;a href="contacts.html"&gt;RSVP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
&lt;/div&gt;
&lt;/header&gt;
&lt;!-- / header --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="body3"&gt;
&lt;div class="main"&gt;



<i> </i>&lt;!-- content --&gt;
<i> </i>&lt;article id="content"&gt;
<i> </i> &lt;div class="wrapper"&gt;
<i> </i> &lt;div class="pad"&gt;
<i> </i> &lt;div class="wrapper"&gt;
<i> </i> &lt;section class="col1"&gt;
<i> </i> &lt;h2&gt;RSVP &lt;span&gt;Form&lt;/span&gt;&lt;/h2&gt;
<i> </i> &lt;body&gt;
<i> </i>Please fill this section out regardless if you are attending or not. Enter your Party's Name, choose # of people attending and input their names&lt;b&gt; (please list children as well)&lt;/b&gt;.
<i> </i>&lt;form action="testpost.php" method="post"&gt;
Family Name:&lt;input class="firstname"
name="dyninput1" enabled required&gt; &lt;br&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-dogs" value="yes" required&gt;
&lt;label for="choice-animals-dogs"&gt;Yes, I would love to.&lt;/label&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-cats" value="no"&gt;
&lt;label for="choice-animals-cats"&gt;No, Sorry I can't make it.&lt;/label&gt;
&lt;select id="dynselect"&gt;
&lt;option value=""&gt;How Many People Will Be Attending?&lt;/option&gt;
&lt;option value="foropt1"&gt;1 Person:&lt;/option&gt;
&lt;option value="foropt2"&gt;2 People:&lt;/option&gt;
&lt;option value="foropt3"&gt;3 People:&lt;/option&gt;
&lt;option value="foropt4"&gt;4 People:&lt;/option&gt;
&lt;option value="foropt5"&gt;5 People:&lt;/option&gt;
&lt;option value="foropt6"&gt;6 People:&lt;/option&gt;
&lt;option value="foropt7"&gt;7 People:&lt;/option&gt;
&lt;option value="foropt8"&gt;8 People:&lt;/option&gt;
&lt;option value="foropt9"&gt;9 People:&lt;/option&gt;
&lt;option value="foropt10"&gt;10 People:&lt;/option&gt;
&lt;/select&gt;
&lt;div id="dyn2"&gt;
&lt;label for="dyninput1"&gt;
&lt;input class="foropt1 foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10"
name="dyninput1" enabled placeholder="Name of 1st Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput2"&gt;
<i> </i> &lt;input class="foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10"
<i> </i> name="dyninput2" enabled placeholder="Name of 2nd Person"&gt;

<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput3"&gt;
<i> </i> &lt;input class="foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput3"
<i> </i> enabled placeholder="Name of 3rd Person"&gt;

<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput4"&gt;
<i> </i> &lt;input class="foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput4"
<i> </i> enabled placeholder="Name of 4th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput5"&gt;
<i> </i> &lt;input class="foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput5"
<i> </i> enabled placeholder="Name of 5th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput6"&gt;
<i> </i> &lt;input class="foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput6" enabled placeholder="Name of 6th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput7"&gt;
<i> </i> &lt;input class="foropt7 foropt8 foropt9 foropt10" name="dyninput7" enabled placeholder="Name of 7th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput8"&gt;
<i> </i> &lt;input class="foropt8 foropt9 foropt10" name="dyninput8" enabled placeholder="Name of 8th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput9"&gt;
<i> </i> &lt;input class="foropt9 foropt10" name="dyninput9" enabled placeholder="Name of 9th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput10"&gt;
<i> </i> &lt;input class="foropt10" name="dyninput10" enabled placeholder="Name of 10th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i>&lt;/div&gt;&lt;textarea name="paragraph_text" cols="50" rows="10" placeholder="Comments/Questions/Concerns"&gt;&lt;/textarea&gt;&lt;br&gt;

<i> </i>&lt;input type="submit"&gt; &lt;script&gt;
function myFunction() {
document.getElementById("myForm").reset();
}
&lt;/script&gt;

&lt;/form&gt;

&lt;script&gt;
document.getElementById("choice-animals-dogs").addEventListener("click", function () {
sel = document.getElementById("dynselect");
sel.style.display = "block";
sel.selectedIndex = 0;
});
document.getElementById("choice-animals-cats").addEventListener("click", function () {
document.getElementById("dynselect").style.display = "none";
// create a list of all inputs
var inputs = document.querySelectorAll("#dyn2 input");
for (var i = 0; i &lt; inputs.length; i++) {
// provide current input
var cinput = inputs[i];
// input should be disabled and invisible
cinput.parentNode.style.display = "none";
cinput.removeAttribute("required");
cinput.setAttribute("disabled", true);
}
});


<i> </i>document.getElementById("dynselect").addEventListener("change", function () {
<i> </i> // create a list of all inputs
<i> </i> var inputs = document.querySelectorAll("#dyn2 input");
<i> </i> // loop through these inputs
<i> </i> for (var i = 0; i &lt; inputs.length; i++) {
<i> </i> // provide current input
<i> </i> var cinput = inputs[i];
<i> </i> // check if this input has class according
<i> </i> // value of the selected option
<i> </i> if (cinput.classList.contains(this.value)) {
<i> </i> // input should be enabled and visible
<i> </i> cinput.parentNode.style.display = "block";
<i> </i> cinput.setAttribute("required", true);
<i> </i> cinput.removeAttribute("disabled");
<i> </i> } else {
<i> </i> // input should be disabled and invisible
<i> </i> cinput.parentNode.style.display = "none";
<i> </i> cinput.removeAttribute("required");
<i> </i> cinput.setAttribute("disabled", true);

<i> </i> }

<i> </i> }
<i> </i>});
&lt;/script&gt;
&lt;/section&gt;
&lt;section class="col2 pad_left2"&gt;
&lt;h2&gt;Our &lt;span&gt;Contacts&lt;/span&gt;&lt;/h2&gt;
&lt;p class="pad_bot1"&gt;Hilton Tampa Airport Westshore
Address: 2225 N. Lois Ave, Tampa Florida 33607
&lt;/p&gt;
&lt;b&gt; E-mail:&lt;/b&gt; &lt;a href="mailto:[email protected]"&gt;[email protected]&lt;/a&gt;
<br/>
<i> </i> Iram's #:
<i> </i> 954-300-7810&lt;br&gt;
Suhayb's #:
315-460-0322&lt;br&gt;&lt;br&gt;
&lt;i&gt;Please do not hesitate to contact us if you have any questions or concerns.&lt;/i&gt;
&lt;/section&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/article&gt;
&lt;!-- content / --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="body2"&gt;
&lt;div class="main"&gt;
&lt;!-- footer --&gt;
&lt;footer&gt;Copyright &amp;copy; &lt;a href="#"&gt;2018&lt;/a&gt; All Rights Reserved&lt;br&gt;
Design by Rahman&lt;/a&gt;&lt;/footer&gt;
&lt;!-- / footer --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;Cufon.now();&lt;/script&gt;
&lt;script&gt;
$(window).load(function () {
$('.slider').nivoSlider({
effect: 'fold', //Specify sets like: 'fold,fade,sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft'
slices: 17,
animSpeed: 500,
pauseTime: 8000,
startSlide: 0, //Set starting Slide (0 index)
directionNav: true, //Next &amp; Prev
directionNavHide: false, //Only show on hover
controlNav: true, //1,2,3...
controlNavThumbs: false, //Use thumbnails for Control Nav
controlNavThumbsFromRel: false, //Use image rel for thumbs
controlNavThumbsSearch: '.jpg', //Replace this with...
controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
keyboardNav: true, //Use left &amp; right arrows
pauseOnHover: true, //Stop animation while hovering
manualAdvance: false, //Force manual transitions
captionOpacity: 1, //Universal caption opacity
beforeChange: function () {},
afterChange: function () {
Cufon.refresh();
},
slideshowEnd: function () {} //Triggers after all slides have been shown
});
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;


Also did i add the zip files correctly from phpmailer?

Thank you very much[upl-image-preview url=https://www.webdeveloper.com/forum/assets/files/2018-10-09/1539116658-827807-tree.png]

[upl-image-preview url=https://www.webdeveloper.com/forum/assets/files/2018-10-09/1539116662-181538-tree1.png]
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — The screenshots regarding the php files and the PHP mailer look fine so far.

However I cannot find the two PHP sections in contacts.php?

Additonally I forgot about this: You need to add name="submit" to the submit tag:
&lt;input type="submit" name="submit"&gt;
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — @Sempervivum#1596651 sorry this is the correct contacts.php. I feel like there is a error in <form action="testpost.php" method="post">


<i>
</i>&lt;?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
require_once 'datacheck.php';
?&gt;
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;title&gt;Rahman | Khaliq | RSVP&lt;/title&gt;
&lt;meta charset="utf-8"&gt;
&lt;link rel="stylesheet" href="css/reset.css" type="text/css" media="all"&gt;
&lt;link rel="stylesheet" href="css/layout.css" type="text/css" media="all"&gt;
&lt;link rel="stylesheet" href="css/style.css" type="text/css" media="all"&gt;
&lt;script src="js/jquery-1.6.js" &gt;&lt;/script&gt;
&lt;script src="js/cufon-yui.js"&gt;&lt;/script&gt;
&lt;script src="js/cufon-replace.js"&gt;&lt;/script&gt;
&lt;script src="js/Josefin_Sans_400.font.js"&gt;&lt;/script&gt;
&lt;script src="js/Tangerine_700.font.js"&gt;&lt;/script&gt;
&lt;script src="js/atooltip.jquery.js"&gt;&lt;/script&gt;
&lt;script src="js/jquery.nivo.slider.pack.js"&gt;&lt;/script&gt;
&lt;script src="js/script.js"&gt;&lt;/script&gt;
&lt;!--[if lt IE 9]&gt;
&lt;script src="js/html5.js"&gt;&lt;/script&gt;
&lt;style type="text/css"&gt;.aToolTip, .box1, .box1 .inner, .button, .button strong{behavior:url("js/PIE.htc");}&lt;/style&gt;

&lt;![endif]--&gt;
&lt;/head&gt;
&lt;body id="page6"&gt;
&lt;div class="body1"&gt;
&lt;div class="main"&gt;
&lt;!-- header --&gt;
&lt;header&gt;
&lt;div class="wrapper"&gt;
&lt;h1&gt;&lt;a href="index.html" id="logo"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;nav&gt;
&lt;ul id="menu"&gt;
&lt;li&gt;&lt;a href="guest.html"&gt;Venue/Accommodations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="guestbook.html"&gt;Guestbook&lt;/a&gt;&lt;/li&gt;
&lt;li class="first" id="menu_active"&gt;&lt;a href="contacts.html"&gt;RSVP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/nav&gt;
&lt;/div&gt;
&lt;/header&gt;
&lt;!-- / header --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="body3"&gt;
&lt;div class="main"&gt;



<i> </i>&lt;!-- content --&gt;
<i> </i>&lt;article id="content"&gt;
<i> </i> &lt;div class="wrapper"&gt;
<i> </i> &lt;div class="pad"&gt;
<i> </i> &lt;div class="wrapper"&gt;
<i> </i> &lt;section class="col1"&gt;
<i> </i> &lt;h2&gt;RSVP &lt;span&gt;Form&lt;/span&gt;&lt;/h2&gt;
<i> </i> &lt;body&gt;
<i> </i>Please fill this section out regardless if you are attending or not. Enter your Party's Name, choose # of people attending and input their names&lt;b&gt; (please list children as well)&lt;/b&gt;.
<i> </i>&lt;form action="testpost.php" method="post"&gt;
Family Name:&lt;input class="firstname"
name="dyninput1" enabled required&gt; &lt;br&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-dogs" value="yes" required&gt;
&lt;label for="choice-animals-dogs"&gt;Yes, I would love to.&lt;/label&gt;
&lt;input type="radio" name="choice-animals" id="choice-animals-cats" value="no"&gt;
&lt;label for="choice-animals-cats"&gt;No, Sorry I can't make it.&lt;/label&gt;
&lt;select id="dynselect"&gt;
&lt;option value=""&gt;How Many People Will Be Attending?&lt;/option&gt;
&lt;option value="foropt1"&gt;1 Person:&lt;/option&gt;
&lt;option value="foropt2"&gt;2 People:&lt;/option&gt;
&lt;option value="foropt3"&gt;3 People:&lt;/option&gt;
&lt;option value="foropt4"&gt;4 People:&lt;/option&gt;
&lt;option value="foropt5"&gt;5 People:&lt;/option&gt;
&lt;option value="foropt6"&gt;6 People:&lt;/option&gt;
&lt;option value="foropt7"&gt;7 People:&lt;/option&gt;
&lt;option value="foropt8"&gt;8 People:&lt;/option&gt;
&lt;option value="foropt9"&gt;9 People:&lt;/option&gt;
&lt;option value="foropt10"&gt;10 People:&lt;/option&gt;
&lt;/select&gt;
&lt;div id="dyn2"&gt;
&lt;label for="dyninput1"&gt;
&lt;input class="foropt1 foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10"
name="dyninput1" enabled placeholder="Name of 1st Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput2"&gt;
<i> </i> &lt;input class="foropt2 foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10"
<i> </i> name="dyninput2" enabled placeholder="Name of 2nd Person"&gt;

<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput3"&gt;
<i> </i> &lt;input class="foropt3 foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput3"
<i> </i> enabled placeholder="Name of 3rd Person"&gt;

<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput4"&gt;
<i> </i> &lt;input class="foropt4 foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput4"
<i> </i> enabled placeholder="Name of 4th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput5"&gt;
<i> </i> &lt;input class="foropt5 foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput5"
<i> </i> enabled placeholder="Name of 5th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput6"&gt;
<i> </i> &lt;input class="foropt6 foropt7 foropt8 foropt9 foropt10" name="dyninput6" enabled placeholder="Name of 6th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput7"&gt;
<i> </i> &lt;input class="foropt7 foropt8 foropt9 foropt10" name="dyninput7" enabled placeholder="Name of 7th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput8"&gt;
<i> </i> &lt;input class="foropt8 foropt9 foropt10" name="dyninput8" enabled placeholder="Name of 8th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput9"&gt;
<i> </i> &lt;input class="foropt9 foropt10" name="dyninput9" enabled placeholder="Name of 9th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i> &lt;label for="dyninput10"&gt;
<i> </i> &lt;input class="foropt10" name="dyninput10" enabled placeholder="Name of 10th Person"&gt;


<i> </i> &lt;/label&gt;
<i> </i>&lt;/div&gt;&lt;textarea name="paragraph_text" cols="50" rows="10" placeholder="Comments/Questions/Concerns"&gt;&lt;/textarea&gt;&lt;br&gt;

<i> </i>&lt;input type="submit" name="submit"&gt; &lt;script&gt;
function myFunction() {
document.getElementById("myForm").reset();
}
&lt;/script&gt;
&lt;?php
if (!empty($errors) &amp;&amp; count($errors) &gt; 0 &amp;&amp; !$success) {
echo implode('', $errors);
} else if (!empty($success) &amp;&amp; count($errors) === 0) {
echo $success;
}
?&gt;
&lt;/form&gt;

&lt;script&gt;
document.getElementById("choice-animals-dogs").addEventListener("click", function () {
sel = document.getElementById("dynselect");
sel.style.display = "block";
sel.selectedIndex = 0;
});
document.getElementById("choice-animals-cats").addEventListener("click", function () {
document.getElementById("dynselect").style.display = "none";
// create a list of all inputs
var inputs = document.querySelectorAll("#dyn2 input");
for (var i = 0; i &lt; inputs.length; i++) {
// provide current input
var cinput = inputs[i];
// input should be disabled and invisible
cinput.parentNode.style.display = "none";
cinput.removeAttribute("required");
cinput.setAttribute("disabled", true);
}
});


<i> </i>document.getElementById("dynselect").addEventListener("change", function () {
<i> </i> // create a list of all inputs
<i> </i> var inputs = document.querySelectorAll("#dyn2 input");
<i> </i> // loop through these inputs
<i> </i> for (var i = 0; i &lt; inputs.length; i++) {
<i> </i> // provide current input
<i> </i> var cinput = inputs[i];
<i> </i> // check if this input has class according
<i> </i> // value of the selected option
<i> </i> if (cinput.classList.contains(this.value)) {
<i> </i> // input should be enabled and visible
<i> </i> cinput.parentNode.style.display = "block";
<i> </i> cinput.setAttribute("required", true);
<i> </i> cinput.removeAttribute("disabled");
<i> </i> } else {
<i> </i> // input should be disabled and invisible
<i> </i> cinput.parentNode.style.display = "none";
<i> </i> cinput.removeAttribute("required");
<i> </i> cinput.setAttribute("disabled", true);

<i> </i> }

<i> </i> }
<i> </i>});
&lt;/script&gt;
&lt;/section&gt;
&lt;section class="col2 pad_left2"&gt;
&lt;h2&gt;Our &lt;span&gt;Contacts&lt;/span&gt;&lt;/h2&gt;
&lt;p class="pad_bot1"&gt;Hilton Tampa Airport Westshore
Address: 2225 N. Lois Ave, Tampa Florida 33607
&lt;/p&gt;
&lt;b&gt; E-mail:&lt;/b&gt; &lt;a href="mailto:[email protected]"&gt;[email protected]&lt;/a&gt;
<br/>
<i> </i> Iram's #:
<i> </i> 954-300-7810&lt;br&gt;
Suhayb's #:
315-460-0322&lt;br&gt;&lt;br&gt;
&lt;i&gt;Please do not hesitate to contact us if you have any questions or concerns.&lt;/i&gt;
&lt;/section&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/article&gt;
&lt;!-- content / --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="body2"&gt;
&lt;div class="main"&gt;
&lt;!-- footer --&gt;
&lt;footer&gt;Copyright &amp;copy; &lt;a href="#"&gt;2018&lt;/a&gt; All Rights Reserved&lt;br&gt;
Design by Rahman&lt;/a&gt;&lt;/footer&gt;
&lt;!-- / footer --&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;script&gt;Cufon.now();&lt;/script&gt;
&lt;script&gt;
$(window).load(function () {
$('.slider').nivoSlider({
effect: 'fold', //Specify sets like: 'fold,fade,sliceDown, sliceDownLeft, sliceUp, sliceUpLeft, sliceUpDown, sliceUpDownLeft'
slices: 17,
animSpeed: 500,
pauseTime: 8000,
startSlide: 0, //Set starting Slide (0 index)
directionNav: true, //Next &amp; Prev
directionNavHide: false, //Only show on hover
controlNav: true, //1,2,3...
controlNavThumbs: false, //Use thumbnails for Control Nav
controlNavThumbsFromRel: false, //Use image rel for thumbs
controlNavThumbsSearch: '.jpg', //Replace this with...
controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
keyboardNav: true, //Use left &amp; right arrows
pauseOnHover: true, //Stop animation while hovering
manualAdvance: false, //Force manual transitions
captionOpacity: 1, //Universal caption opacity
beforeChange: function () {},
afterChange: function () {
Cufon.refresh();
},
slideshowEnd: function () {} //Triggers after all slides have been shown
});
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — You are right, that action is a relict of my testing. action needs to be an empty strings as the same page has to be loaded:
&lt;form action="" method="post"&gt;
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — changed, it... when submitted I got the "Your Message was sent successfully!" but no email

http://rahmankhaliq.com/contacts.php

I placed the datacheck.php in the root with everything else -->
[code]<?php
// add PHP Mailer
use PHPMailerPHPMailerPHPMailer;
require_once 'phpmailer/src/Exception.php';
require_once 'phpmailer/src/PHPMailer.php';
const HTML_ERROR_START = '<div class="alert alert-danger" role="alert"><p class="m-0">';
const HTML_ERROR_END = '</p></div>';
const HTML_SUCCESS_START = '<div class="alert alert-success" role="alert"><p class="m-0">';
const HTML_SUCCESS_END = '</p></div>';

$receiver = '[email protected]';
$emailfrom = '[email protected]';
$namefrom = 'Contact Form';
/**
* 1. Check if form was submitted.
*/
if (isset($_POST['submit'])) {
/**
* 2. Filter data
* - We use the function htmlspecialchars()
* - The function trim() is used to remove all empty spaces from start and end of the string
*/
$choice = htmlspecialchars(trim($_POST['choice-animals']));
$persons = [];
for ($i = 1; isset($_POST['dyninput' . $i]); $i++) {
$persons[] = htmlspecialchars(trim($_POST['dyninput' . $i]));
}

$errors = [];
$success = false;
$nr = 1;
foreach ($persons as $cperson) {
if (empty($cperson)) {
$errors[] = HTML_ERROR_START . 'Please enter a name for person no. ' . $nr . ' !' . HTML_ERROR_END;
$nr++;
}
}

// for testing only
if (empty($receiver)) {
$errors[] = HTML_ERROR_START . 'Please enter the email address of the receiver!' . HTML_ERROR_END;
}
/**
* 4. Check if there were errors, if not send email
* - for sending email we use PHPMailer
*/
if (count($errors) === 0) {
$mailer = new PHPMailer();
$mailer->CharSet = 'UTF-8'; // Set charset setzen for correct display of special characters
$mailer->setFrom($emailfrom, $namefrom); // Set email address and name of sender
$mailer->addAddress($receiver); // Empf채ngeradresse
$mailer->isHTML(true);
$mailer->Subject = 'New message'; // Subject
$mailer->Body = '<h3>New message</h3>
<h3>Choice was: ' . $choice . '</h3>
<h2>Persons:</h2>';
foreach ($persons as $cperson) {
$mailer->Body .= $cperson . '<br>';
}
/**
* Check if email was sent successfully
* if so: Report success
* if not: Report error(s)
*/
if (!$mailer->send()) {
$errors[] = HTML_ERROR_START . 'An errror occured. Please try again in some minutes!' . HTML_ERROR_END;
} else {
$success = HTML_SUCCESS_START . 'Your Message was sent successfully!' . HTML_SUCCESS_END;
}
}
}[code]
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — when submitted I got the "Your Message was sent successfully!"[/quote]That's very fine and indicates that the script has run fine.
$receiver = '[email protected]';This defines the address the email is being sent to. Did you check that account? Also check the spam folder.
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — No Luck, could it be the file path for this section of the code is incorrect?
use PHPMailerPHPMailerPHPMailer;
require_once 'phpmailer/src/Exception.php';
require_once 'phpmailer/src/PHPMailer.php';


here is my directory.

[upl-image-preview url=https://www.webdeveloper.com/forum/assets/files/2018-10-09/1539119745-815673-treee.png]
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — When viewing your screenshots I'm quite shure that the paths of the PHP mailer and the PHP files are correct. Error reporting is on, thus the script would output an error if something would be wrong about the paths or anything else in the script.

What's confusing me is: Above you posted that the email should be sent to [email protected]. However in datacheck.php you defined [email protected] as the receiver. Is this correct?
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — @Sempervivum#1596657 The email should be [email protected] not the other one thats why I changed it.

What else could be the issue. Maybe my fields/textboxes are not set up so it dosnt know what data to email out?
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — I'm a bit helpless now. Recently I supported another webmaster in implementing a contact form. There was an issue that the from email had to be registered in the management of the webspace. Initially we didn't know about this and sending email failed. I recommend contacting your provider if there are such limitations or similar ones. I expect that the support can view some logfiles and find out the reason why sending the mail fails.

I'm fairly shure that the contents of the message or the status of the inputs has no effect on the success of sending the email.
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — @Sempervivum#1596659 I'm hosting it through GoDaddy. So I should contact them?
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — Yes, I recommend doing so. Tell them that you are sending an email by use of PHP mailer and the send function reports true or success but the email doesn't arrive at the recipient.
Copy linkTweet thisAlerts:
@soupiiauthorOct 09.2018 — Ok sir. Can you point me in the right direction in where to put the full name and person 1-10 and comments section in the script
Copy linkTweet thisAlerts:
@SempervivumOct 09.2018 — 
  • 1. Give a name to your input for "family name":
    Family Name:&lt;input class="firstname"
    name="family-name" required&gt;

    The textarea for comments should be OK regarding this.


  • 2. Use this code for datacheck.php. I added reading the new inputs and including it in the body of the email.
    &lt;?php
    // add PHP Mailer
    use PHPMailerPHPMailerPHPMailer;
    require_once 'phpmailer/src/Exception.php';
    require_once 'phpmailer/src/PHPMailer.php';
    const HTML_ERROR_START = '&lt;div class="alert alert-danger" role="alert"&gt;&lt;p class="m-0"&gt;';
    const HTML_ERROR_END = '&lt;/p&gt;&lt;/div&gt;';
    const HTML_SUCCESS_START = '&lt;div class="alert alert-success" role="alert"&gt;&lt;p class="m-0"&gt;';
    const HTML_SUCCESS_END = '&lt;/p&gt;&lt;/div&gt;';

    $receiver = '[email protected]';
    $emailfrom = '[email protected]';
    $namefrom = 'Contact Form';
    /**
    * 1. Check if form was submitted.
    */
    if (isset($_POST['submit'])) {
    /**
    * 2. Filter data
    * - We use the function htmlspecialchars()
    * - The function trim() is used to remove all empty spaces from start and end of the string
    */
    $choice = htmlspecialchars(trim($_POST['choice-animals']));
    $persons = [];
    for ($i = 1; isset($_POST['dyninput' . $i]); $i++) {
    $persons[] = htmlspecialchars(trim($_POST['dyninput' . $i]));
    }

    <i> </i>// New
    <i> </i>$familyname = htmlspecialchars(trim($_POST['family-name']));
    <i> </i>$comments = htmlspecialchars(trim($_POST['paragraph_text']));

    <i> </i>$errors = [];
    <i> </i>$success = false;
    <i> </i>$nr = 1;
    <i> </i>foreach ($persons as $cperson) {
    <i> </i> if (empty($cperson)) {
    <i> </i> $errors[] = HTML_ERROR_START . 'Please enter a name for person no. ' . $nr . ' !' . HTML_ERROR_END;
    <i> </i> $nr++;
    <i> </i> }
    <i> </i>}
    <i> </i>if (empty($familyname)) {
    <i> </i> $errors[] = HTML_ERROR_START . 'Please enter a family name!' . HTML_ERROR_END;
    <i> </i>}

    <i> </i>// for testing only
    <i> </i>if (empty($receiver)) {
    <i> </i> $errors[] = HTML_ERROR_START . 'Please enter the email address of the receiver!' . HTML_ERROR_END;
    <i> </i>}
    <i> </i>/**
    <i> </i> * 4. Check if there were errors, if not send email
    <i> </i> * - for sending email we use PHPMailer
    <i> </i> */
    <i> </i>if (count($errors) === 0) {
    <i> </i> $mailer = new PHPMailer();
    <i> </i> $mailer-&gt;CharSet = 'UTF-8'; // Set charset setzen for correct display of special characters
    <i> </i> $mailer-&gt;setFrom($emailfrom, $namefrom); // Set email address and name of sender
    <i> </i> $mailer-&gt;addAddress($receiver); // Empfängeradresse
    <i> </i> $mailer-&gt;isHTML(true);
    <i> </i> $mailer-&gt;Subject = 'New message'; // Subject
    <i> </i> $mailer-&gt;Body = '&lt;h3&gt;New message&lt;/h3&gt;
    <i> </i> &lt;h3&gt;Choice was: ' . $choice . '&lt;/h3&gt;
    <i> </i> // new
    <i> </i> &lt;h3&gt;Family name was: ' . $familyname . '&lt;/h3&gt;
    <i> </i> &lt;h2&gt;Persons:&lt;/h2&gt;';
    <i> </i> foreach ($persons as $cperson) {
    <i> </i> $mailer-&gt;Body .= $cperson . '&lt;br&gt;';
    <i> </i> }
    <i> </i> $mailer-&gt;Body .= '&lt;h2&gt;Comments were:&lt;/h2&gt;';
    <i> </i> // new
    <i> </i> $mailer-&gt;Body .= $comments;
    <i> </i> /**
    <i> </i> * Check if email was sent successfully
    <i> </i> * if so: Report success
    <i> </i> * if not: Report error(s)
    <i> </i> */
    <i> </i> if (!$mailer-&gt;send()) {
    <i> </i> $errors[] = HTML_ERROR_START . 'An errror occured. Please try again in some minutes!' . HTML_ERROR_END;
    <i> </i> } else {
    <i> </i> $success = HTML_SUCCESS_START . 'Your Message was sent successfully!' . HTML_SUCCESS_END;
    <i> </i> }
    <i> </i>}
    }
    I tested this using my own email address and it worked fine.
  • Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — I made the changes but the email is still not showing and godaddy is saying contact yahoo and see why it is now sending out... Do u have other suggestions.
    Copy linkTweet thisAlerts:
    @nucaginoOct 10.2018 — How to install https://tanktroubleunblocked.mobi/ for free
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — @Sempervivum#1596659 IT did work, not sure what I can do to make it work on my end!
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — I did, message sent successfully, please give feedback if you received it.
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — I posted this issue to the community of godaddy, unfortunately no reply yet. Removed you email addresses of cource.

    https://www.godaddy.com/community/Managing-Email/Sending-email-by-PHPMailer-using-PHP-mail-not-SMTP/m-p/119895#M9298
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — @Sempervivum#1596682 someone stated this

    "Godaddy and other sites sometimes need you to use a FROM email address from the site.

    Otherwise, it is considered spam. And, the recipient never gets the email as it sort-of disappears!

    Also, some email systems such as AOL, Gmail, Yahoo and others will dump emails if they do not hold to

    a strict series of email standards set up by the government and then even more restrictions by them.

    Usually, you can fix this by creating one email account on your server and using that as the FROM address.

    If you do not really want to have to log into Godaddy’s webmail system to keep up to date with emails, you

    can simply forward all mail from your Godaddy’s email account to you personal account. I have done this on

    one of my Godaddy servers and it works well. I set the email system to default to [email protected] and

    set the info@ email account to forward all mail to my personal account. Works great. Now, on any site on

    that domain, I can use [email protected], Info@, Help@, Billing@, ETC@ and all of them come to my

    personal account.

    Anyway, got off track! I am guessing it is your FROM address."

    Do you know what he is referring to?
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — That reads plausible. Now when reading this I remember that with the contact form of the other webmaster I mentioned, we had the same issue. Do you have an email account at godaddys's?. Then use that adress as the from address.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — I changed it to this, and no luck...

    I also found this thread not sure if its helpful.

    https://www.godaddy.com/community/Managing-Email/Can-t-Get-GoDaddy-Hosting-and-PHPMailer-to-work/td-p/57698
    &lt;?php
    // add PHP Mailer
    use PHPMailerPHPMailerPHPMailer;
    require_once 'phpmailer/src/Exception.php';
    require_once 'phpmailer/src/PHPMailer.php';
    const HTML_ERROR_START = '&lt;div class="alert alert-danger" role="alert"&gt;&lt;p class="m-0"&gt;';
    const HTML_ERROR_END = '&lt;/p&gt;&lt;/div&gt;';
    const HTML_SUCCESS_START = '&lt;div class="alert alert-success" role="alert"&gt;&lt;p class="m-0"&gt;';
    const HTML_SUCCESS_END = '&lt;/p&gt;&lt;/div&gt;';

    $receiver = '[email protected]';
    $emailfrom = '[email protected]';
    $namefrom = 'Contact Form';
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — Reply at Godaddy's community:

    https://de.godaddy.com/community/Managing-Email/Sending-email-by-PHPMailer-using-PHP-mail-not-SMTP/m-p/119918?isc=gdcommment#M9302

    He gives same information as the source you quoted previously: The sender address should be associated with your Godaddy account. I got no information about your tarif or package. Is email included? At the hoster of the webmaster I mentioned previously (alfahosting) we could forward an email address at the hoster to the webmaster's one at a different provider without the need of a mailbox or email account at alfahosting.
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — PS: I assume that [email protected] is your website at Godaddys?
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — Correct, [email protected] is my go daddy email, so what should i do?
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — Then obviously this requirement is fullfilled now:
    you can fix this by creating one email account on your server and using that as the FROM address.[/quote]
    Got no idea what we can do now to fix this.
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — Hi soupii,

    in the answer at the community there is one more instruction given:
    You'll also want to make sure that domain has an SPF record that allows sending from our email servers (secureserver.net).[/quote]I found this resource:

    https://www.godaddy.com/help/add-an-spf-record-19218

    describing how to add such record.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — I tried and no luck.

    Can you see if i did it correct

    username: haseebrahman7

    PW: Pendoor77!

    I will change pw tonight
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — I think maybe the script needs to change i found these online

    https://www.godaddy.com/community/cPanel-Hosting/Using-PHPMailer-on-cPanel/td-p/106060

    https://www.godaddy.com/help/sending-form-mail-with-cpanel-and-plesk-shared-hosting-8960

    Is it possible that the REQUER-ONCE is not pointing to the correct location or spelling of the autoload.php file. Thefolder structure and make it point to the correct PHPmailerAutoload.php file. (It is normally in the phpmailer folder, but, you have it pointing to the src folder.) ?
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — I highly recommend not to post user/pw in a public thread. If you want to share these, use PM. I don't have sufficient knowledge regarding Godaddy to check if your actions were correct.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 10.2018 — if you click on cpanal you access my coding base.
    Copy linkTweet thisAlerts:
    @SempervivumOct 10.2018 — I recommend to continue in the thread at Godaddy's community. This issue has exceeded the limitations of my knowledge and the guys over there seem to be much more scilled und will be able to assist you.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 11.2018 — Hey U, I think the issue was, subject of the email. "New message" is one that sometimes gets flagged as spam. I changed it to $mailer->Subject = 'New RSVP!'; // Subject

    $mailer->Body = '<h3><I>Someone has made a reservation.</I></h3> and now I am getting the emails.... Weird huh...

    Last question I have is do you know How I can make the input boxes not look invisible so it is easy to read?

    [upl-image-preview url=https://www.webdeveloper.com/forum/assets/files/2018-10-11/1539284727-636963-capture.png]
    Copy linkTweet thisAlerts:
    @SempervivumOct 11.2018 — That's great that it works now!

    Regarding the inputs: In my testing environment they have a narrow dark edge so that they are visible. In your contact form there is this CSS rule in reset.css:
    * {
    border: none;
    }
    which removes the border.

    You can add the border easily:
    input {
    border: 1px solid grey;
    }
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 11.2018 — Is there a way to show different success messages for someone that chooses yes vs no...

    If they choose yes and fill it out, and click submit it will say "thank you see you soon." when they click no and enter info and click submit the message will say "you will be missed"
    Copy linkTweet thisAlerts:
    @SempervivumOct 11.2018 — Yes, this can be done easily. Change the code at the bottom of datacheck.php to this:
    /**
    * Check if email was sent successfully
    * if so: Report success
    * if not: Report error(s)
    */
    if (!$mailer-&gt;send()) {
    $errors[] = HTML_ERROR_START . 'An errror occured. Please try again in some minutes!' . HTML_ERROR_END;
    } else {
    if ($choice == 'yes') {
    $success = HTML_SUCCESS_START . 'Thank you see you soon!' . HTML_SUCCESS_END;
    } else {
    $success = HTML_SUCCESS_START . 'You will be missed!' . HTML_SUCCESS_END;
    }
    }
    }
    }
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 11.2018 — Thank you, do you think a pop up would be better with those messages rather then appearing at the bottom?

    Or is there a way to disable the fields and show the user what they have entered once AFTER they click submit? so they wont have the option to re-enter it


    Reason I ask this is because the ppl who enter will be non tech ppl and I don't want them to wonder if they submitted it or not... Will save a headache for us .. Thanks U
    Copy linkTweet thisAlerts:
    @SempervivumOct 12.2018 — You might consider using Sweetalert for the popup:

    https://sweetalert2.github.io

    Check if you like it.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 12.2018 — I like the Custom animation (Animate.css )

    But not sure how to install/implement it.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 12.2018 — I tried to add it in but guess it didn't work...
    Copy linkTweet thisAlerts:
    @SempervivumOct 12.2018 — Do you have it online? I cannot view the PHP then but the Javacript.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 13.2018 — No i removed it, but if you view my page you can see the current working model .... www.rahmankhaliq.com/contacts.php
    Copy linkTweet thisAlerts:
    @SempervivumOct 13.2018 — The best would be if you put it online again, so that I can view it. If you do not like to have a page online that doesn't work, upload it with a different name.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 13.2018 — what do you mean go online
    Copy linkTweet thisAlerts:
    @SempervivumOct 13.2018 — I meant it's no good if your visitors encounter a page that is not working. And I recommend to upload the faulty files with a different name, e. g. contact-faulty.php and and datacheck-faulty.php. Then the original file is still working for your visitors.
    Copy linkTweet thisAlerts:
    @soupiiauthorOct 13.2018 — oh yeah i understand, but I havnt sent out a link yet, i will once i get the pop up working
    Copy linkTweet thisAlerts:
    @SempervivumOct 13.2018 — Then it should be no problem to upload the modified files even if they are not working.
    ×

    Success!

    Help @soupii spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...