Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using variables with document.form.submit

Status
Not open for further replies.

kisk

Programmer
Feb 14, 2003
21
US
Ok, I run a directory site and it has a lot of links, and I'm trying to set up a way for users to notify me if they find a dead link in my directory. Below I've provided some sample code of how my pages are set up now...

'## Start: Page

<head>
<SCRIPT language=&quot;JavaScript&quot;><!--
function popDeadLink(linkID){
var linkform = 'Link' + linkID;
settings='width=300,height=60';
var n = window.open('about:blank','DeadLink',settings);
document.forms[linkform].submit;
return true;
}
//-->
</SCRIPT>
</head>

<body>

<p><a href=&quot;#&quot; onclick=&quot;javascript:popDeadLink(5);&quot;>Report dead link</a></p>
<form name=&quot;Link5&quot; action=&quot; method=&quot;Post&quot; target=&quot;DeadLink&quot;>
</form>

<p><a href=&quot;#&quot; onclick=&quot;javascript:popDeadLink(10);&quot;>Report dead link</a></p>
<form name=&quot;Link10&quot; action=&quot; method=&quot;Post&quot; target=&quot;DeadLink&quot;>
</form>

</body>

'## End: Page

With that code, it opens up the window, but it doesn't post the form to it. I think the line that reads, &quot;document.forms[linkform].submit;&quot; is the problem. If anybody could help me out it would be greatly appreciated. Oh, and I need it to Post; Get will not work for what I am doing.

Thanks,
-- kisk
 

add the parenthesis to the end of submit line...

**
document.forms[linkform].submit();
**

hope that helps...

-g
 
awesome... werkin now... thx a lot man =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top