By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,435 Members | 2,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,435 IT Pros & Developers. It's quick & easy.

Parsing Textbox Value Through Hyperlink

P: n/a
I have a form with a textbox for the user to enter a quantity and another
textbox for the delivery date. I disabled this delivery date textbox such
that the user has to press a calendar link next to the textbox, then a
calendar will pop up for him to choose the date. The dates that the user can
pick depends a lot on the quantity that he enters in the quantity field.

Is there any way that I can parse the quantity field to the calendar page
when the user press the calendar link? I am using a asp hyperlink, instead of
a button, because if I use a button, I'll have 2 buttons on the same form,
the calendar button and a submit button. As a result, (I don't understand
why), when the user click on the calendar button, the program will do some
client side verification for the data entered and the calendar will never
show. And I also don't know how to let the calendar page to pop out by
initiating from a button.

Can someone help me? Thank you.
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

How have you implemented the popup calendar page? Is it an .aspx page or
just a plain HTML file with DHTML/JS calendar? In the former case, you can
use query string to pass the quantity value to the aspx page like this:

// Assuming txtQty is the name/ID of the Quantity text box
<a href="#' onclick="window.open('popup.aspx?qty=' +
document.all['txtQty'].value);">Show Calendar</a>

Use Request.QuertString["qty"] in the popup.aspx to grap the quantity.

If you use a static HTML, use opener.document.all['txtQty'].value in the
popup window to get the quantity value.

Hope this helps?
"wrytat" wrote:
I have a form with a textbox for the user to enter a quantity and another
textbox for the delivery date. I disabled this delivery date textbox such
that the user has to press a calendar link next to the textbox, then a
calendar will pop up for him to choose the date. The dates that the user can
pick depends a lot on the quantity that he enters in the quantity field.

Is there any way that I can parse the quantity field to the calendar page
when the user press the calendar link? I am using a asp hyperlink, instead of
a button, because if I use a button, I'll have 2 buttons on the same form,
the calendar button and a submit button. As a result, (I don't understand
why), when the user click on the calendar button, the program will do some
client side verification for the data entered and the calendar will never
show. And I also don't know how to let the calendar page to pop out by
initiating from a button.

Can someone help me? Thank you.

Nov 19 '05 #2

P: n/a
Thank you.

This is how i did it, i have a javascript for popping up the calendar.

function popupcal(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=300,height=350, top=0, left=0,
scrollbars=yes,resizable=yes');
return false;
}

I have a hyperlink, <asp:HyperLink id="hlCal" onclick="return popupcal(this,
'calendar')" runat="server"></asp:HyperLink>, that's for the calendar.

In part of my .aspx codes, I defined the hyperlink's navigate url as,
hlCal.NavigateUrl = "calendar.aspx?comp=" + RealComp +
"&FormName=fmAdd&CtrlName=txtDate&qty="

I tried hlCal.NavigateUrl = "calendar.aspx?comp=" + RealComp +
"&FormName=fmAdd&CtrlName=txtDate&qty=document .all['txtQty'].value);" but it
doesn't work. What can I do?

"Siva M" wrote:
Hi,

How have you implemented the popup calendar page? Is it an .aspx page or
just a plain HTML file with DHTML/JS calendar? In the former case, you can
use query string to pass the quantity value to the aspx page like this:

// Assuming txtQty is the name/ID of the Quantity text box
<a href="#' onclick="window.open('popup.aspx?qty=' +
document.all['txtQty'].value);">Show Calendar</a>

Use Request.QuertString["qty"] in the popup.aspx to grap the quantity.

If you use a static HTML, use opener.document.all['txtQty'].value in the
popup window to get the quantity value.

Hope this helps?
"wrytat" wrote:
I have a form with a textbox for the user to enter a quantity and another
textbox for the delivery date. I disabled this delivery date textbox such
that the user has to press a calendar link next to the textbox, then a
calendar will pop up for him to choose the date. The dates that the user can
pick depends a lot on the quantity that he enters in the quantity field.

Is there any way that I can parse the quantity field to the calendar page
when the user press the calendar link? I am using a asp hyperlink, instead of
a button, because if I use a button, I'll have 2 buttons on the same form,
the calendar button and a submit button. As a result, (I don't understand
why), when the user click on the calendar button, the program will do some
client side verification for the data entered and the calendar will never
show. And I also don't know how to let the calendar page to pop out by
initiating from a button.

Can someone help me? Thank you.

Nov 19 '05 #3

P: n/a
Just to add on,

I need to get the Request Quantity in the popup calendar for the PageLoad
and DayRender codes, to determine which dates can be selected and which
cannot. My calendar is an <asp:Calendar>

Thank you.

"wrytat" wrote:
Thank you.

This is how i did it, i have a javascript for popping up the calendar.

function popupcal(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=300,height=350, top=0, left=0,
scrollbars=yes,resizable=yes');
return false;
}

I have a hyperlink, <asp:HyperLink id="hlCal" onclick="return popupcal(this,
'calendar')" runat="server"></asp:HyperLink>, that's for the calendar.

In part of my .aspx codes, I defined the hyperlink's navigate url as,
hlCal.NavigateUrl = "calendar.aspx?comp=" + RealComp +
"&FormName=fmAdd&CtrlName=txtDate&qty="

I tried hlCal.NavigateUrl = "calendar.aspx?comp=" + RealComp +
"&FormName=fmAdd&CtrlName=txtDate&qty=document .all['txtQty'].value);" but it
doesn't work. What can I do?

"Siva M" wrote:
Hi,

How have you implemented the popup calendar page? Is it an .aspx page or
just a plain HTML file with DHTML/JS calendar? In the former case, you can
use query string to pass the quantity value to the aspx page like this:

// Assuming txtQty is the name/ID of the Quantity text box
<a href="#' onclick="window.open('popup.aspx?qty=' +
document.all['txtQty'].value);">Show Calendar</a>

Use Request.QuertString["qty"] in the popup.aspx to grap the quantity.

If you use a static HTML, use opener.document.all['txtQty'].value in the
popup window to get the quantity value.

Hope this helps?
"wrytat" wrote:
I have a form with a textbox for the user to enter a quantity and another
textbox for the delivery date. I disabled this delivery date textbox such
that the user has to press a calendar link next to the textbox, then a
calendar will pop up for him to choose the date. The dates that the user can
pick depends a lot on the quantity that he enters in the quantity field.

Is there any way that I can parse the quantity field to the calendar page
when the user press the calendar link? I am using a asp hyperlink, instead of
a button, because if I use a button, I'll have 2 buttons on the same form,
the calendar button and a submit button. As a result, (I don't understand
why), when the user click on the calendar button, the program will do some
client side verification for the data entered and the calendar will never
show. And I also don't know how to let the calendar page to pop out by
initiating from a button.

Can someone help me? Thank you.

Nov 19 '05 #4

P: n/a
In the JS funtion popupcal(), have

href = "calendar.aspx?Qty=" + document.all['<%= txtQty.ClientID %>'].value;
// Append more query strings if required

before calling window.open(). You can then fetch the quantity as
Request.QueryString["txtQty"] (C#) in calendar.aspx (Page load and other
subsequent methods) should get you the quantity text box value.

No need to set NavigateUrl in the code-behind.
"wrytat" <wr****@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
Thank you.

This is how i did it, i have a javascript for popping up the calendar.

function popupcal(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
href=mylink;
else
href=mylink.href;
window.open(href, windowname, 'width=300,height=350, top=0, left=0,
scrollbars=yes,resizable=yes');
return false;
}

I have a hyperlink, <asp:HyperLink id="hlCal" onclick="return popupcal(this,
'calendar')" runat="server"></asp:HyperLink>, that's for the calendar.

In part of my .aspx codes, I defined the hyperlink's navigate url as,
hlCal.NavigateUrl = "calendar.aspx?comp=" + RealComp +
"&FormName=fmAdd&CtrlName=txtDate&qty="

I tried hlCal.NavigateUrl = "calendar.aspx?comp=" + RealComp +
"&FormName=fmAdd&CtrlName=txtDate&qty=document .all['txtQty'].value);" but it
doesn't work. What can I do?

"Siva M" wrote:
Hi,

How have you implemented the popup calendar page? Is it an .aspx page or
just a plain HTML file with DHTML/JS calendar? In the former case, you can
use query string to pass the quantity value to the aspx page like this:

// Assuming txtQty is the name/ID of the Quantity text box
<a href="#' onclick="window.open('popup.aspx?qty=' +
document.all['txtQty'].value);">Show Calendar</a>

Use Request.QuertString["qty"] in the popup.aspx to grap the quantity.

If you use a static HTML, use opener.document.all['txtQty'].value in the
popup window to get the quantity value.

Hope this helps?
"wrytat" wrote:
I have a form with a textbox for the user to enter a quantity and
another
textbox for the delivery date. I disabled this delivery date textbox
such
that the user has to press a calendar link next to the textbox, then a
calendar will pop up for him to choose the date. The dates that the user
can
pick depends a lot on the quantity that he enters in the quantity field.

Is there any way that I can parse the quantity field to the calendar
page
when the user press the calendar link? I am using a asp hyperlink,
instead of
a button, because if I use a button, I'll have 2 buttons on the same
form,
the calendar button and a submit button. As a result, (I don't
understand
why), when the user click on the calendar button, the program will do
some
client side verification for the data entered and the calendar will
never
show. And I also don't know how to let the calendar page to pop out by
initiating from a button.

Can someone help me? Thank you.

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.