Forums

Javascript inside post, need help! (2 posts)

  1. jeriksson
    Member
    Posted 8 months ago #

    Hi,

    I have some issues understanding why i can't use javascripts in my posts.

    I've read the details that i've found on google, and i still can't get it to work.

    This is the javascript i want to work

    <SCRIPT LANGUAGE="JavaScript">
    function Login(form) {
    var username = form.username.value;
    var password = form.password.value;
    
    if (username && password) {
    var ftpsite = "ftp://" + username + ":" + password + "@" + "myftpserver.god.org:642";
    window.location = ftpsite;
    }
    else {
    alert("Please enter your username, password.");
       }
    }
    //  End -->
    </script>

    And then im using html code for the login form:

    <form name=login>
    <table width=250 border=1 cellpadding=1 bordercolor=#736AFF>
    
    <tr>
    </tr>
    <tr>
    <td>Username:</td>
    <td><input type=text name=username size=20 value=anonymous></td>
    </tr>
    <tr>
    <td>Password:</td>
    <td><input type=password name=password size=20 value=anonymous></td>
    </tr>
    <tr>
    <td colspan=2 align=center>
    <input type=button value="Login" onClick="Login(this.form)"></td>
    </tr>
    </table>
    </form>

    Issue is the button "login" isn't clickable, which tells me something is wrong.

    Please help me! thanks!

  2. mfields
    Member
    Posted 8 months ago #

    Please see this thread:
    http://wordpress.org/support/topic/147154?replies=4

    Although you can enable javascript in your post content, it is not very secure to so.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.