Implementing javascript in wordpress page
-
I am trying to implement a javascript code, that I created using html, dreamweaver, in one of my wordpress pages. I am having difficulty in having wordpress engage the code.
Any suggestions or observations?
Here is the code:
//
<html>
<body><script type=”text/javascript”>
function logMe(){
var myTextField = document.getElementById(‘myText’);
var myPass = document.getElementById(‘myPass’);
if(myTextField.value == “ifp” && myPass.value == “ifp001”)
{
alert(“Welcome IF Properties”)
parent.location=’https://invpropmgt.com/property-owners/existing-owners/if-properties/’
}
else if(myTextField.value == “fwreone” && myPass.value == “fwreone001”)
{
alert(“Welcome Fort Wayne Real Estate One”)
parent.location=’https://invpropmgt.com/property-owners/existing-owners/fort-wayne-real-estate-one/’
}
else if(myTextField.value == “mgi” && myPass.value == “mgi001”)
{
alert(“Welcome Mosaic Gold Investments”)
parent.location=’https://invpropmgt.com/property-owners/existing-owners/mosaic-gold-investments/’
}
else if(myTextField.value == “rri” && myPass.value == “rri001”)
{
alert(“Welcome Right Relations Inc.”)
parent.location=’https://invpropmgt.com/property-owners/existing-owners/right-relations/’
}
else if(myTextField.value == “jrogers” && myPass.value == “jrogers001”)
{
alert(“Welcome janel Rogers”)
parent.location=’https://invpropmgt.com/property-owners/existing-owners/janel-rogers/’
}
else if(myTextField.value == “tstockamp” && myPass.value == “tstockamp001”)
{
alert(“Welcome Thomas Stockamp”)
parent.location=’https://invpropmgt.com/property-owners/existing-owners/thomas-stockamp/’
}else
alert(“You have entered an incorrect username or password” + ‘\n’ +”Please try again!”)
}
</script>
<table width=”370″ border=”0″>
<tr>
<th scope=”col”>User Name</th>
<th scope=”col” align=”right”><input type=’text’ id=’myText’ /></th>
</tr>
<tr>
<th scope=”row”>Password</th>
<td align=”right” scope=”col”><input type=’password’ id = ‘myPass’/></td>
</tr>
</table>
<table width=”200″ border=”0″>
<tr>
<th scope=”col”><input type=’button’ onClick=’logMe()’ value=’Log In’ /></th>
</tr>
</table>
</body>
</html>
//
- The topic ‘Implementing javascript in wordpress page’ is closed to new replies.