-
1. Re: Javascript newbie login question
Nancy OShea Aug 29, 2015 6:23 PM (in response to revdave)1 person found this helpfulSo I am trying to create a simple login setup where:
login.html
- some login and password form
that can pass this info to an external php site that processes the request and can return the result back to the login.html (non php) page
I'm sorry, you completely lost me... It's been a long day and a very hot one.
Can you elaborate a bit more?
Nancy O.
-
2. Re: Javascript newbie login question
revdave Aug 29, 2015 6:27 PM (in response to Nancy OShea)Hi Nancy - you are Sooooooo quick!
I submitted to early by accident - I hope this makes more sense now...
basically I want HTML LOGIN FORM PAGE 1 to submit to external PHP page and come back to HTML page with the result
just don't know how to submit the form using javascript so the result come bak in json.....
-
3. Re: Javascript newbie login question
revdave Aug 29, 2015 6:30 PM (in response to revdave)i just found this on the web ----- might be a good start
I will maybe turn it into a son 'get' and see if that works.....
<HTML>
<HEAD>
<TITLE>Test Input</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function testResults (form) {
var TestVar = form.inputbox.value;
alert ("You typed: " + TestVar);
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box: <BR>
<INPUT TYPE="text" NAME="inputbox" VALUE=""><P>
<INPUT TYPE="button" NAME="button" Value="Click" onClick="testResults(this.form)">
</FORM>
</BODY>
</HTML>
-
4. Re: Javascript newbie login question
revdave Aug 29, 2015 6:53 PM (in response to revdave)Thanks much Nancy...
Hi this seems to work well for a starter....
so the form above is cool and I added the $.get inside the function......
So I will keep working with this....
<SCRIPT LANGUAGE="JavaScript">
function testResults (form) {
var TestVar = form.login.value;
var TestVar2 = form.pass.value;
// alert ("You typed: " + TestVar + TestVar2);
$.get("http://gohere.com/login.php add Testvar etc. here.......", function(data, status){ xxxxxxxxxxxxxxx