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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'href' using javascript

Status
Not open for further replies.

perryair

IS-IT--Management
Apr 7, 2005
91
0
0
IL
Guys,
I'm trying to submit a form using javascript, the problem is that the 'href' is already connected to dynamic asp page that I make query on..

It looks like I need to create js that allow me to ran 2 commands at the same time.

Any ideas?

Here is the code..

<form action="query22.asp" method="post" name="form3">
<input type="hidden" name="indX" value="index.asp?intCatalogID=<%= Server.URLEncode(strParam) %>&amp;page=<%= iPageCurrent %>">
<td align="center">
<table border="0" id="table7" width="155">
<tr>
<td width="3">
<p align="center">
&nbsp;</td>
<td style="border-left-style: dotted; border-left-width: 1px; border-right-width: 1px; border-top-style: dotted; border-top-width: 1px; border-bottom-width: 1px" colspan="2" align="center">
<a href="index.asp?intCatalogID=<%= rsProdInfo("catalogID")%>&pid=<%= rsProdInfo("ImgNumber")%>" onclick="javascript: sf()">
<img border="0" src="<%= rsProdInfo("SmallImg")%>"></td>
<td width="3">
&nbsp;</td>
</tr>
</table>
<p align="center">&nbsp;</td>
</form>


<SCRIPT language="JavaScript">
function sf()
{
document.form3.submit();
}
</SCRIPT>
 
You can target the anchor to a new unnamed window like this.

[tt]<a href="index.asp?intCatalogID=<%= rsProdInfo("catalogID")%>&pid=<%= rsProdInfo("ImgNumber")%>" [blue]target="_blank"[/blue]>
<img border="0" src="<%= rsProdInfo("SmallImg")%>" [blue]alt="SmallImg"[/blue] onclick=[red]"sf()"[/red]>[red]</a>[/red]
[/tt]
 
Still doesn't send the form content to next page (query22.asp) ...

Correction: index.asp and query22.asp is the same page.

Thanks..
 
Make sure you capture the form contents sent with method appropriate to method post (rather than get).
 
Well, It is already "post"...

Thank you anyway for all your help, I will try to figure out on another forum..
 
>Well, It is already "post"...
I meant your hyperlink send info practically with method get and your form submitted via the function sf is using method post. Hence, your asp page must be scripted apt to capture both format of info.

>Well, It is already "post"...
Feel absolutely free to do so. I have tested my advice and you still don't get the essense of it. No need to drag on.
 
The second quote should be:
> I will try to figure out on another forum..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top