Hexagora Forum
Hexagora Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Dynamic HTML Editor
 Dynamic HTML Editor
 control email format
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

didbou
Practical

17 Posts

Posted - 07 Mar 2008 :  11:51:34  Show Profile  Visit didbou's Homepage  Reply with Quote
Good morning, I'm not (yet) a JS specialist ;-) I'll know the JS to check the email format in my form.
Thank'a a lot

s.dav
Site Admin

Italy
3364 Posts

Posted - 07 Mar 2008 :  12:01:52  Show Profile  Visit s.dav's Homepage  Reply with Quote
function checkEmail (sEmail)
{
var re = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;
if (re.test(sEmail))
return true;
else
return false;
}

Regards, Davide
Go to Top of Page

didbou
Practical

17 Posts

Posted - 07 Mar 2008 :  15:30:43  Show Profile  Visit didbou's Homepage  Reply with Quote
Thank's Davide but how write it into HTML Editor?

Regards
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 08 Mar 2008 :  14:00:18  Show Profile  Visit s.dav's Homepage  Reply with Quote
Open the page properties, go to the section Scripts/Events, click on the "Header Code" tab, create a <Script> block and paste the code above inside it.

Then in the Form, OnSubmit event execute the function above.

Regards, Davide
Go to Top of Page

Testa
Expert

Italy
74 Posts

Posted - 16 Mar 2009 :  23:55:17  Show Profile  Visit Testa's Homepage  Reply with Quote
I'm sorry for this question, but i don't understand how the function works?
when i make onsubmit="return checkEmail (XXXX)" what is the argument (XXXX)that i need to past inside? Is it the text mail of the form or somthing else?
And what's the variable re?

Thanks a lot.

My Google+ profile:
https://plus.google.com/i/zw25-_gKvTY:jRss3zGURdE

Web sites made in DHTML:

http://terapiabrevestrategica-emilia.it/
http://papaveriepapere-ravenna.com/
http://mp-impianti.net/
http://assistudioperboni.it/
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 17 Mar 2009 :  08:56:30  Show Profile  Visit s.dav's Homepage  Reply with Quote
The function checkEmail checks for a valid email address so you have to give it a valid string that specifies an email address

Act as follows:
1- create a form, draw into it a text field and name it "txtEmail"; then draw into it a button and set its type to "submit"

2- go to the page properties and create a script block then paste into it the checkEmail function.
3- under it write this additional function

// this function checks if the form contains all required data
function checkInput()
{
var s="";
var semail=document.getElementById('txtEmail').value;
if (!checkEmail(semail))
s+="Please write a valid email address!\r\n";

if (s) {
alert(s);
return false;
}
return true;
}

4- in the onSubmit event of the form write "return checkInput();"
5- you can customize the "checkInput" function so it can checks all fields of your form.

Regards, Davide
Go to Top of Page

Testa
Expert

Italy
74 Posts

Posted - 17 Mar 2009 :  14:02:04  Show Profile  Visit Testa's Homepage  Reply with Quote
Thanks a lot. I try it asap.

Bye.

My Google+ profile:
https://plus.google.com/i/zw25-_gKvTY:jRss3zGURdE

Web sites made in DHTML:

http://terapiabrevestrategica-emilia.it/
http://papaveriepapere-ravenna.com/
http://mp-impianti.net/
http://assistudioperboni.it/
Go to Top of Page

arthur
Practical

23 Posts

Posted - 14 Jan 2010 :  09:29:41  Show Profile  Visit arthur's Homepage  Reply with Quote
i have just downloaded yesterday your program , nawe i want to make a field that sombody can send me a email and i surst your help and forum for this i know i have to make a form submitbutten and than its blank for me can sombody gif me the wricht directions pleas ?
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 14 Jan 2010 :  17:35:03  Show Profile  Visit s.dav's Homepage  Reply with Quote
Please check the program help under the "form object" and "form settings";

the basic idea behind all is:
1- create a form object
2- draw input elements into the form
3- set the form for using the "built in email processor"
4- draw a "submit" button into the form

you're done ;-)

Regards, Davide
Go to Top of Page

arthur
Practical

23 Posts

Posted - 15 Jan 2010 :  08:07:14  Show Profile  Visit arthur's Homepage  Reply with Quote
ok thanks that i did olready but id didnt do anything i have as mi brouzer chrom from google and nawe i tride it with windows brouzer and it lookt that he liked to send samthing .. but nathing kame to mi email adres do you have to export it furst to a surver for that ? and is it podible the problem was chrom of google ?
Go to Top of Page

s.dav
Site Admin

Italy
3364 Posts

Posted - 15 Jan 2010 :  08:54:03  Show Profile  Visit s.dav's Homepage  Reply with Quote
If your page is .asp you need to upload into a server that supports .asp servers; if your page is .php you need to upload it into a server that supports .php pages.
The email processor will never work locally.

Regards, Davide
Go to Top of Page

arthur
Practical

23 Posts

Posted - 15 Jan 2010 :  12:22:44  Show Profile  Visit arthur's Homepage  Reply with Quote
ok thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Hexagora Forum © s.dav Go To Top Of Page
Snitz Forums 2000