In this tutorial we will see how to create a registration confirmation form to schedule courses.
To more information about sc_send_email() macro, click here.
1. Create a control type application.
To more information about how create a control app, click here.
2. Click on New Field
3. We will add 9 fields according to the image below.
4. Go to the “Javascript” menu, where we will create validation events for our form ..
5. Select the “news” field and the “onClick” event and then click on “edit“.
6. We will use the code below to check or uncheck the checkboxes of the “opt_languages” field according to what is selected in the “news“.
news – onClick
if(document.F1.news[1].checked)
{
for (I=0;i<documentF1elementslength;...I++)
{if(documentF1elements[i]type... == "checkbox")
{
document.F1.elements[i].checked=false;
document.F1.elements[i].disabled = true;
}
}
} else {
for (I=0;i<documentF1elementslength;...I++)
{if(documentF1elements[i]type... == "checkbox")
{
document.F1.elements[i].checked=1;
document.F1.elements[i].disabled = false;
}
}
}
7. We will create also a code in the Form, OnSubmit event.
Form – onSubmit
if(document.F1.Course.SelectedIndex == 0) {
alert('Select a course');
return false;
}
8. Now access the onValidate event of the application.
9. Use the code below to add options
news – onClick
$ msg = " <table border= &# 39; 1 & # 39; bordercolor = & # 39; # CCCCCC & # 39; cellpadding = & # 39; 5 & # 39; cellspacing = & # 39; 0 & # 39; width = & # 39; 600 & # 39; height = & # 39; 260 & # 39; style = & # 39; border-collapse: collapse & # 39; & gt; & quot ;;
$ msg . = " <tr> ";
$ msg . = " <td valign= &# 39; top & # 39; style = & # 39; margin: 0; & # 39; & gt; & quot ;;
$ msg . = " <p> ";
$ msg . = " <b> <font size= &# 39; 4 & # 39; face = & # 39; Verdana, Arial, Helvetica, sans-serif & # 39; color = & # 39; # fe5800 & # 39; & gt; Registration Confirmed & lt; / font & gt; & lt; / b & gt; & quot ;;
$ msg . = " <br> ";
$ msg . = " <b> <font size= &# 39; 3 & # 39; face = & # 39; Verdana, Arial, Helvetica, sans-serif & # 39; color = & # 39; # 4a80ca & # 39; & gt; {nome} & lt; / font & gt; & lt; / b & gt; & quot ;;
$ msg . = " <br/ > ";
$ msg . = " <br/ > ";
$ msg . = " <b> <font size= &# 39; 3 & # 39; face = & # 39; Georgia, Times New Roman, Times, serif & # 39; color = & # 39; # fe5800 & # 39; & gt; Personal Data: & lt; / font & gt; & lt; / b & gt; & quot ;;
$ msg . = " <br/ > ";
$ msg . = " <br/ > ";
$ msg . = " <b> <font size= &# 39; 2 & # 39; face = & # 39; Verdana, Arial, Helvetica, sans-serif & # 39; color = & # 39; # 4a80ca & # 39; & gt; Email: {email} & lt; font & gt; & lt; / b & gt; & quot ;;
$ msg . = " <br/ > ";
$ msg . = " <br/ > ";
$ msg . = " <b> <font size= &# 39; 2 & # 39; face = & # 39; Verdana, Arial, Helvetica, sans-serif & # 39; color = & # 39; # 4a80ca & # 39; & gt; Best Time: {best_time} & lt; font & gt; & lt; / b & gt; & quot ;;
$ msg . = " <br/ > ";
$ msg . = " <br/ > ";
$ msg . = " <b> <font size= &# 39; 2 & # 39; face = & # 39; Verdana, Arial, Helvetica, sans-serif & # 39; color = & # 39; # 4a80ca & # 39; & gt; Options: {opt_lingagues} & lt; font & gt; & lt; / b & gt; & quot ;;
$ msg . = " <br/ > ";
$ msg . = " <br/ > ";
$ msg . = " <b> <font size= &# 39; 2 & # 39; face = & # 39; Verdana, Arial, Helvetica, sans-serif & # 39; color = & # 39; # 4a80ca & # 39; & gt; Message: {text} & lt; font & gt; & lt; / b & gt; & quot ;;
$ msg . = " < /p> ";
$ msg . = " < /td> ";
$ msg . = " < /tr> ";
$ msg . = " <tr> ";
$ msg . = " < /tr> ";
$ msg . = " < /table> ";
sc_mail_send("wwwnetmakecombr"..., &Quot;" &Quot;" "no-reply@netmake.com.br" {email}, "Scriptcase - Samples"
$ msg, "H" " " , &Quot;" &Quot;" "N" " ");
// sc_mail_send (& quot; localhost & quot ;, & quot; & quot ;, & quot; & quot ;, {email_from}, {email_to}, {subject}, $ message, & quot; H & quot;);
if ({sc_mail_ok}) {
threw out " <script>alert(&# 39; Message sent successfully! Will receive a confirmation email & # 39;); & lt; / script & gt; & quot ;;
sc_redir(mcr15.php);
} else {
sc_error_message("There was a problem in sending! Please contact the System
Administrator through telephone (xx) xxxx-xxxx. &Quot;);
}
10. Run the application
Comment this post