Lunarpages Web Hosting Forum

Scripting Languages Hosting Help => JavaScript Support => Topic started by: almtlm on October 06, 2004, 11:27:49 AM

Title: Beginer help
Post by: almtlm on October 06, 2004, 11:27:49 AM
I have a program that sends variable data by way of email using a java script ( created in lectora by trivantis).
It functions correctly from my home computer and from tech suport at Lunar pages but not from my computer at work nor my wifes computer at her work.
I suspect that there is something going on with a fire wall.
Is there a way for the email to be processed just on the Lunar pages server with out involving the user's computers mail system?
Title: Beginer help
Post by: Lupine1647 on October 06, 2004, 12:04:34 PM
PHP may be your answer here.
Title: Beginer help
Post by: GMTurner on October 06, 2004, 12:12:01 PM
Just to make sure I'm understanding the question...

You have a java script which when you access is supposed to send information via email. It works when you access it from home and it works when tech support accesses it, but it does not work when you access it from work. Correct?

What do you mean by it does not work? Are you not able to access the script at all or does it just not send the email?
Title: Beginer help
Post by: TranzNDance on October 06, 2004, 12:14:47 PM
Could you post the link to the script?
Title: Beginer help
Post by: almtlm on October 06, 2004, 04:17:58 PM
here is the section of script from the page that gets the variables for the form and the submitial of the form by email.
The submitial is sucessfull at home and by lunar pages support but not at two other computers.
Since I would like for people to take the  training from computers that may be at a work site I would like to know why it might not be getting sent.
I suspect firewall issues.
THanks for your help

function trivUpdateEntry() {
  entry312.objLyr.doc.forms["entry312form"]["Name"].blur();
  entry314.objLyr.doc.forms["entry314form"]["email"].blur();
  entry316.objLyr.doc.forms["entry316form"]["Phone"].blur();
  entry318.objLyr.doc.forms["entry318form"]["Comment"].blur();
}

function Update_entry318( upd ) {
  if (upd.value.length > 250) {
    alert( 'You have exceeded the maximum allowable size for this field (250 characters)' )
    upd.value = upd.value.substring(0,250)
    upd.focus()
    upd.select()
    return false;
  }
  VarEntry_0004.set(upd.value)
  return true;
}

function Process_form310() {
  var titleMgr = getTitleMgrHandle()
  if( titleMgr ) {
    if(VarDisply_pic.f > 0) VarDisply_pic.uDT(); else VarDisply_pic.getValue();
    if(VarEntry_0001.f > 0) VarEntry_0001.uDT(); else VarEntry_0001.getValue();
    if(VarEntry_0002.f > 0) VarEntry_0002.uDT(); else VarEntry_0002.getValue();
    if(VarEntry_0003.f > 0) VarEntry_0003.uDT(); else VarEntry_0003.getValue();
    if(VarEntry_0004.f > 0) VarEntry_0004.uDT(); else VarEntry_0004.getValue();
    entry312.objLyr.doc.forms["entry312form"]["Name"].blur()
    titleMgr.addFormElement( 'Name', VarEntry_0001.getValue() )
    entry314.objLyr.doc.forms["entry314form"]["email"].blur()
    titleMgr.addFormElement( 'email', VarEntry_0002.getValue() )
    entry316.objLyr.doc.forms["entry316form"]["Phone"].blur()
    titleMgr.addFormElement( 'Phone', VarEntry_0003.getValue() )
    entry318.objLyr.doc.forms["entry318form"]["Comment"].blur()
    titleMgr.addFormElement( 'Comment', VarEntry_0004.getValue() )
    var errMsg = titleMgr.emailForm( 'a.murphy@e-trainingsolutions.com', false, false )
    if( errMsg ) alert( errMsg )
    else alert( 'Your information has been successfully submitted.' )
  }
}
Title: Beginer help
Post by: GMTurner on October 06, 2004, 05:16:34 PM
What is the error that you get when you submit the form? What about it does not work? You said that the submission doesn't work, but can you be more specific about the error?

Also, on the page that handles the submission, are you checking the referrer to the page? Basically trying to make sure that the data is being submitted from the form... if so, some firewalls and security software block the referrer info from being sent which could be the cause of the problem... again, depending on what exactly the problem with submitting it is.
Title: Beginer help
Post by: almtlm on October 06, 2004, 06:52:31 PM
The erro message that shows in a pop up message screen is
mail i/o error
If it is a fire wall issue with certin computer networks  can I have the program use a php script to use a mail program on the same server as the web page.
If so any recomendations?
Thanks
Title: Beginer help
Post by: Aiham on October 06, 2004, 07:28:01 PM
Google can be your friend:

http://email.about.com/cs/phpemailtips/qt/et031202.htm

Or

http://www.totallyphp.co.uk/code/send_email_using_the_php_mail_function.htm

These are just basic ones that I found on the first page of a Google search, but ofcourse there are more complex scripts that can give extra details such as why an error occured, or something similar.
Title: Beginer help
Post by: GMTurner on October 06, 2004, 07:31:41 PM
I'm still not completely clear on how things are supposed to work here... been a long day...

Can we get a link to the form? I might be able to figure out more if I could actually see what is going on with everything...
Title: Beginer help
Post by: almtlm on October 06, 2004, 07:53:54 PM
Sure
e-trainingsolutions.com
the submit problem is on the request info page.
Title: Beginer help
Post by: GMTurner on October 06, 2004, 08:16:11 PM
Okay... this looks like it will end up being more of a javascript problem than email... the code used seems to be excessive for what you are really needing it to do... not your fault but the program you used to create this page didn't create the "prettiest" code...

Anyway, the script is basically being run on the client via the browser (javascript) to send the email... and hence the computer it is being used on has to allow for outgoing mail being sent from a webpage... now that I've seen the full page I understand the code you included earlier a little better... at least what it is trying to do...

My recommended solution would be to scratch this whole approach and create a simple HTML form that upon being submitted would send the contents to a script to mail the information... I'd go with a PHP script, but there are other options out there... the links MrHammami gave could help... but a lot will depend on how much you know about PHP and creating the HTML forms...

Also, you might be able to get more assistance from people in the javascript forum who might be able to suggest a workaround using javascript... I don't know that much about javascript...
Title: Beginer help
Post by: TranzNDance on October 06, 2004, 08:47:42 PM
I'll move this over to the javascript section.

edit: move done.
Title: Beginer help
Post by: almtlm on October 07, 2004, 04:01:35 AM
Thanks
That is what I thought
Code is not my strong point. I can follow the logic but my typing erros are the death of me. Even good code does not work when I misspell and dont use caps on a server file but in the code ;}.
Will look at some simple PHP script.
Title: Beginer help
Post by: faisal on October 07, 2004, 05:14:17 AM
I think it is much more easier to do it using JSPs. If your server have the support of JSPs then following link will help you.
See http://www.lunarforums.com/forum/viewtopic.php?t=13587

You can do it in no time using above code.

Using jsps/servlet mean no issue of firewall as the jsp code will execute on the server and not on the client side. So it will work from everywhere...
Title: Beginer help
Post by: almtlm on October 07, 2004, 06:12:07 AM
Thanks guys that will cover exactly what I am looking for and since I have proof it works on LP then I can hunt my typos and such till it works!
Title: Re: Beginer help
Post by: iris2027 on October 07, 2010, 12:15:24 AM
It helps beginner a lot! Thanks!

Title: Re: Beginer help
Post by: wilmatan on April 30, 2011, 05:46:44 AM
Is javascript the one used for flash animations? I'm really having a hard time. I only know basic HTML. :cry:
Title: Re: Beginer help
Post by: scanman20 on April 30, 2011, 07:26:50 AM
Is javascript the one used for flash animations? I'm really having a hard time. I only know basic HTML. :cry:
No, not usually. Flash uses Actionscript as its scripting language, although you can also use JavaScript to pass information into Flash.
Title: Re: Beginer help
Post by: wilmatan on April 30, 2011, 11:58:47 PM
 :hypno: great, so I really need to learn this action scripting stuff..., I only use motion tween in some of my flash animations..., I want to modify it more...^_^

btw, thanks scanman20  :yey:
Title: Re: Beginer help
Post by: frozen on November 16, 2011, 01:59:19 AM
hey..... duh :hiya:

This is a scripting language. This is a real programming language that browers understand. For example let's say in HTML you have a text box where someone can type in something.. but you don't want them to write naughty words in it. You could use Javascript to parse the text that was typed in in order to check for naughty words.

Javascript allows you to do things on a webpage that HTML and XML won't let you do. HTML is the base, with Javascript sitting on top of it. XML is like a data file standing outside the main sphere of HTML/Javascript.

Christmas Treasure Hunt (http://treasurehuntclues.org/christmas-treasure-hunt.html)