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

Adding Values before passing to ASP Page

Status
Not open for further replies.

gradinumcp

IS-IT--Management
Apr 6, 2005
85
US
Hi there! I just need a small help with passing values via a javascript to the ASP page using window.open.

I have 2 integer values on the page, one is a and one is b.

I want to be able to pass c which is a+b to this page.

Heres the code--any clue what iam doing wrong???

<SCRIPT LANGUAGE="JAVASCRIPT">
<!--

function Add()
{

window.open(Page1.asp?c='+int('+document.form.a.value+')+ int('+document.form.b.value+')+' &value='+document.form.name.value, target='_self');

}

//-->
</SCRIPT>
 
The JavaScript forum may provide better answers: forum216

Also something looks fishy with your string deliminators...

window.open(Page1.asp?c=[highlight]'+int('[/highlight]+document.form.a.value+[highlight]')+ int('[/highlight]+document.form.b.value+[highlight]')+'[/highlight] &value=[highlight]'+document.form.name.value, target='[/highlight]_self[red]'[/red]);
 
Hey Guys I think I figured it out...

var c= parseInt(document.form.a.value) + parseInt(document.form.b.value)

window.open(Page1.asp?c='+c+'&value='+document.form.name.value, target='_self');

Thanks:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top