June 14, 200421 yr Hi Using a form i want to [color:"red"] register all the inputs in a new record and at the same time that the user click "submit" [color:"red"] send a mail to someone acording with [color:"red"] one of the values of a select input in the same form I can do each step separately , for example TO REGISTER i use .. <select [color:"red"] name="responsable" size="1"> <option value="[email protected]">All the projects FMP-Portal: Cod_tasks_CodProject] <option value="[FMP-Field: Cod_tasks_CodProject::MailPerResponsable]">[FMP-Field: Cod_tasks_CodProject::NomTask] [/FMP-Portal] </select> TO SEND THE MAIL, i use <select [color:"red"] name="-MailCC" size="1"> <option value="[email protected]">All the projects FMP-Portal: Cod_tasks_CodProject] <option value="[FMP-Field: Cod_tasks_CodProject::MailPerResponsable]">[FMP-Field: Cod_tasks_CodProject::NomTask] [/FMP-Portal] </select> but, how can i do both things simultaneously thanks a lot Mon
June 14, 200421 yr Hi, Mon! Using CDML only, I do not think you can do both at the same time.... possibly in conjunction with other scripting, though. I'd suggest just using a META REFRESH for an intermediate processing page to send the mail message(s). form > mail > final --ST
June 15, 200421 yr Author hi, steve .. thanks for your answer i have create a intermediate page in wich i have place a hidden form to send the mail .. the i use the form , in the firs step, to add the register to the database and it's OK but, in the second step, i have problems to submit the hiden form automatically to send the mail i use .. <body onload="contactmail.form1.submit();" ... then i use a META REFRESH to activate another thanks page to indicate the values are stored and the resposabla has been notified by mai, the first thing is true but not the second . somethin like .. <META HTTP-EQUIV="refresh" CONTENT="1; URL=FMPro?-db=contact&-lay=Detail&-format=contactmerci.htm&-error=noresults.htm&-view"> The form is defined with <form name="form1" action="FMPro" method="POST"> all the references to the onLoad tag use some like <body onload="document.form1.submit();" or even short .. <body onload="form1.submit();" if I use this last one i hace a popup mesage error 4 if i use the firts whit "document" .. also if i replace "document" by the name of the page "contactmail" the popup error message disapear, the thanks page rises but no mail is send anywhere the question is , how to activate the hidden form to indicates a Filemaker to send the mail ? any ideas are welcome thanks a lot Mon
June 15, 200421 yr Try an "onload" in the <body> tag. You can add a new Record and send the email with the one Form. Here is the syntax from the "CDML Reference" database: <form action="FMPro" method="post"> <input type="hidden" name="-DB" value="contacts.fp5"> <input type="hidden" name="-Format" value="displaypage.html"> <input type="text" name="-MailTo" value="[email protected]"> <input type="text" name="-MailCC" value="[email protected]"> <input type="text" name="-MailBCC" value="[email protected]"> <input type="text" name="-MailFrom" value="[email protected]"> <input type="text" name="-MailSub" value="The Subject"> <input type="hidden" name="-MailHost" value="SMTP.Company.COM"> <input type="hidden" name="-MailFormat" value="mail.txt"> <input type="submit" name="-View" value="Send Message"> </form> Other tags that are required -DB, -MailFrom, -MailSub, -MailHost, -MailFormat, any action tag See also -MailCC, -MailBCC Good Luck Garry
June 15, 200421 yr Author Yes .. okai Garry .. but how do you do if you wan send the mail to someone according with one value specified in one of the inputs on this form ?? imagine ... in the form you have a input select field acordint with the choice of the user you must send the mail this mail to diferent detinations tha`s is the modele thanks again Mon p.s: in your example you only send the mail but the fields are not added to a new record if you use .. type="submit" name="-View" that will be .. type="submit" name="-add"
June 15, 200421 yr Hi, Mon! FMWebSchools has a FAQ that has info you'd probably be interested in... http://www.fmwebschool.com/FAQ.htm#AutomaticEmail Hope it helps! --ST
June 15, 200421 yr You can use some Javascript. For example: <script> function addAddress() { document.myform.elements["-mailto"].value = document.myform.responsible.value ; document.myform.submit() ; } </script> </head> <body>..... <form name="myform" action="FMPro" method="POST" onsubmit="addAddress(); return false;"> <input type="hidden" name="-DB" value="contacts.fp5"> <input type="hidden" name="-Format" value="displaypage.html"> <input type="text" name="-mailto" value=""> <input type="text" name="-MailCC" value="[email protected]"> <input type="text" name="-MailBCC" value="[email protected]"> <input type="text" name="-MailFrom" value="[email protected]"> <input type="text" name="-MailSub" value="The Subject"> <input type="hidden" name="-MailHost" value="SMTP.Company.COM"> <input type="hidden" name="-MailFormat" value="mail.txt"> Enter address: <input type="text" name="responsible" value=""> <input type="submit" name="-new" value="Send Message"> </form> All the best. Garry
June 16, 200421 yr Author Hi, finally this feature is working fine i follow the Method #2 of the link pointed by Steve using a intemediate redirected page Your procedure Garry also looks a good alternative a lot of thanks to all Mon
Create an account or sign in to comment