This page use javascript to be the login button,
I don't know how to deal with it.


<ul class="list all"><li class="item item-1 item-odd"><a class="thumbnail" href="http://www.xanga.com" title="Xanga.com - The Blogging Community"><img src="" alt="Xanga.com - The Blogging Community" /></a><div class="details"><div class="itembody"><a href="http://www.xanga.com/register.aspx"><strong>What is Xanga?</strong> Xanga is a community where you can start your own free weblog, share photos and videos, and meet new friends, too! <em>Click Here to Get Started »</em><span class="talkarrow"></span></a></div></div></li></ul>
<div class="extra"></div>
</div>

</div>
<div class="module module-custom module-signin-box" id="module--95">

<div class="modulecontent">


<form id="SigninForm" class="Form1" method="post" action="">
<input name="IsPostBack" type="hidden" id="IsPostBack" />
<ul class="list details-only">
<li class="item item-1 item-odd">
<div class="details">
<h4 class="itemtitle"><label for="XangaHeader_txtSigninUsername">Username</label></h4>
<div class="itembody">
<input name="XangaHeader$txtSigninUsername" type="text" id="XangaHeader_txtSigninUsername" maxlength="100" onmouseover="this.className='over';" onmouseout="this.className='';" onfocus="this.className='over';" onblur="this.className='';" tabindex="1" />
</div>
</div>
</li>
<li class="item item-2 item-even">
<div class="details">
<h4 class="itemtitle"><label for="XangaHeader_txtSigninPassword">Password</label></h4>
<div class="itembody">
<input name="XangaHeader$txtSigninPassword" type="password" id="XangaHeader_txtSigninPassword" maxlength="16" onkeypress="return SigninOnEnter(event);" onmouseover="this.className='over';" onmouseout="this.className='';" onfocus="this.className='over';" onblur="this.className='';" tabindex="2" />
<a id="signin" href="javascript: SigninSubmit();" tabindex="3">Sign In</a>
</div>
</div>
</li>
</ul>

Dani AI

Generated

: the symptom is that the visible sign-in control calls a JavaScript function that isn’t defined, so clicking does nothing. is right that submitting the form from script fixes the immediate problem, but the post missed an important detail: accessing a form as document.FormName requires a name attribute on the form. In the markup shown the form only has an id, so that shortcut can be undefined.

A more robust, unobtrusive fix is to bind a click handler to the sign-in element and call the form’s submit method by id. For example:

<script>
document.addEventListener('DOMContentLoaded', function () {
  var btn = document.getElementById('signin');
  var f = document.getElementById('SigninForm'); // safe when only an id exists
  if (btn && f) {
    btn.addEventListener('click', function (e) {
      e.preventDefault();
      f.submit();
    }, false);
  }
});
</script>

Notes and troubleshooting tips that weren’t in the thread:

  • Prefer a real <button type="submit"> (or an <input type="submit">) inside the form instead of an anchor with javascript:; it’s simpler, more accessible and works without JS.
  • If the login target is on another site, a normal form POST from the browser will work, but AJAX will be blocked by CORS unless the target allows it. Automation from a server side script usually fails if the site requires session cookies or anti-CSRF tokens.
  • Use developer tools: check the Console for JS errors, look at Network to confirm the POST payload and response, and verify the form fields and any hidden tokens expected by the server.
  • Always send credentials over HTTPS and avoid storing plaintext passwords.

This addresses the missing handler and gives a safer, testable approach that improves on the simple snippet suggested earlier.

What is exact problem? This form is not working?
SigninSubmit function is not defined in current code.
Add this code to submit form.

<script language="javascript">
function SigninSubmit()
{
	document.SigninForm.submit();
}
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.