|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Post form values to a Pop-Up window using <a href='#' onclick=... ......>
How do I post form variables from parent window to a new pop-up window.
<script language=javascript> function openHCPReport() { window.open("Report.aspx","printwind); } </script> <form name = f1 > <a href='#' onclick="javascript penReport();" >Print Report </a><input type=hidden value=123 name=txtNum> </form> I do not want to use onsubmit event on the form. Using onclick on the hyperlink, how do I submit the form values. I tried adding document.f1.method='post'; document.f1.submit; to the javascript function , but no use. Infact, I have tried using target attribute too... Can I post the form the pop-up on a hyperlink?? I was unsuccessful in making it work. I would greatly appreciate if someone can please provide the complete code with a short example . I want to access the hidden value using Request.Form("txtNum") . Thanks. |
|
#2
|
||||
|
||||
|
try this
Code:
<script language=javascript>
function OpenReport(rID)
{
var objWin, varURL
varURL = 'Report.aspx?ReportID=' + rID
objWin = window.open(varURL,'','left=300,top=300,toolbar=fa lse,status=yes,directories=false,menubar=false,scr ollbars=false,resizable=false,copyhistory=false,wi dth=300,height=75'); ****
}
</script>
<form name = f1 >
<a href='#' onclick="javascriptpenReport(<%=txtNum%>);" >Print Report </a>
</form>
|
|
#3
|
|||
|
|||
|
Using Request.Form ?????
I can pass it through querystring. That's the reason , I said
"Post". I should be able to retrieve using Request.Form("txtNum") |
|
#4
|
||||
|
||||
|
You would need to use Server.Transfer
|
|
#5
|
|||
|
|||
|
for <a href='#' onclick="javascriptpenReport(<%=txtNum%>);" I'm doing something like this, but for the 'txtNum', mine would change depending on which button user clicks, how could i do that ? Because for now what I'm doing - <A href="javascript:OpenCalendar('txtDate0', false);"><A href="javascript:OpenCalendar('txtDate0', false);"> how can I don't hard code the 'txtDate0' ???
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Post form values to a Pop-Up window using <a href='#' onclick=... ......> |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|