DAIBOLA

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:contact [2018/05/19 08:54] adminen:contact [2024/03/23 21:43] (current) admin
Line 1: Line 1:
 +<WRAP tabs>
 +  * [[en:contact|English]]
 +  * [[de:contact|Deutsch]]  
 +  * [[zh:contact|中文]]  
 +</WRAP>
  
 +====== Contact ======
 +
 +<form>
 +action mail gunnar.lindenblatt@daibola.biz
 +labels :en:contact_form_labels
 +thanks "Thanks for contacting us!"
 +
 +fieldset   "Your contacts"
 +email      email ^
 +textbox  fullname 
 +textbox   streetaddress ! 
 +number  phone  !
 +yesno callback 
 +
 +fieldset "Your message"
 +select subject "- - -|Book Order|ChinaBridge|DeHanCi.com|Product Internationalisation|Protect + Care|sedamo|Smart Learning Factory|Web Check|Others"
 +textbox "Your reference" !
 +textbox "Our reference" !
 +textarea "Message"
 +
 +fieldset ""
 +submit "Send"
 +</form> 
 +
 +<PHP>
 +echo '
 +<script>
 +// Get the text field element
 +var formemail = document.querySelector(\'input[name="bureaucracy[1]"]\');
 +var formfullname = document.querySelector(\'input[name="bureaucracy[2]"]\');
 +var formstreetaddress = document.querySelector(\'input[name="bureaucracy[3]"]\');
 +var formphone = document.querySelector(\'input[name="bureaucracy[4]"]\');
 +
 +let api_url = "/json_api_call_test_hidden.php?email=";
 +async function getData() { 
 +        // console.log("Starting...");
 +        formfullname.value = "sedamo!";
 + var email_var = formemail.value; 
 + // console.log("e-mail:" + email_var);
 + const response = await fetch(api_url + email_var);
 + const data = await response.json();
 + // console.log(data);
 + const { status, message, sedamo, nameline1, nameline2, phone } = data;
 +        if (status == "ok") { 
 +                formfullname.value = nameline1;
 +                formstreetaddress.value = "sedamo: " + sedamo;
 +                formphone.value = "+" + phone;
 +        }
 +        else {
 +                formfullname.value = "";
 +                if (status == "error") { formstreetaddress.value = "⚠ " + message; } 
 +        }
 +}
 +
 +
 +// Add event listener
 +formemail.addEventListener(\'change\', function(event) {
 +  // event handling code:
 +  getData(); 
 +});
 +</script>
 +';
 +
 +</PHP>