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)

5+ Year Member

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 Jul 22, 2008 (gmt 0)

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

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>

Featured Threads

Hot Threads This Week

Hot Threads This Month