Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Can javascript form.submit() use https?

Why does browser say "insecure" on form.submit()?

6:13 pm on Jul 22, 2008 (gmt 0)

New User

5+ Year Member

joined:July 22, 2008
posts: 2
votes: 0

Why does Firefox generate a warning dialog when a SUBMIT button uses the form.submit() javascript function? The warning says, "Although this page is encrypted, the information you have entered is to be sent over an unencrypted connection and could easily be read by a third party." The page containing the button and the call to submit() was loaded through https. Can this page be made secure, or is the warning spurious?
8:30 pm on July 22, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

Welcome aboard ordovico!

You have to have something else wrong, you got me curious . . . so I did exactly what you said, and get no such error. Are you using full URL's? Relative?

Tested both post and get, neither are causing a security alert. Try installing HTTP Live Headers in FF, might tell you what's up. (?) The error will be in where it's posting to.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script type="text/javascript">
function submitForm (form) {
alert('jussa test');
return false;
<form method="post" action="/note_relative/path_to_script.cgi"
id="form2" onSubmit="return submitForm(this);">
<p><label for="text2">Text 2</label>
<input type="text" name="text2" id="text2"></p>
<p><input type="submit" value="Submit Form"></p>

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members