473,378 Members | 1,378 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

ASP - Passing data to Parent Page from Calendar Page

Hi

i m working with HTML with ASP, Javascript and i am facing a problem with monthly calender date selection. I am able to dispaly calender in seprate window /explorer. But i am not able to pass that date value to main HTML Page input box that is selected by client. What i should do to pass that value back to kind of ASP file to Kind of HTML file. Or there is another way to do this

MSG
May 31 '08 #1
12 1824
idsanjeev
241 100+
Hi

What i should do to pass that value

MSG
Hi manjeetgrang
you are using date calender from java and you have value in form 12:00 so,
use to pass date value
Expand|Select|Wrap|Line Numbers
  1. <%session.LCID=3081%>
  2.  
thanks
Jun 2 '08 #2
DrBunchman
979 Expert 512MB
Hi manjeetgrang
you are using date calender from java and you have value in form 12:00 so,
use to pass date value
Expand|Select|Wrap|Line Numbers
  1. <%session.LCID=3081%>
  2.  
thanks
idsanjeev,

How will this help to pass the date value back to his original page? Unless I am missing something, using Session.LCID merely sets the Locale of your session to a particular location - in this instance Australian English. This can be useful for changing the format of dates, currencies etc that are displayed on your page.

Am I incorrect or have you perhaps misunderstood the original question?

Dr B
Jun 2 '08 #3
DrBunchman
979 Expert 512MB
Hi

i m working with HTML with ASP, Javascript and i am facing a problem with monthly calender date selection. I am able to dispaly calender in seprate window /explorer. But i am not able to pass that date value to main HTML Page input box that is selected by client. What i should do to pass that value back to kind of ASP file to Kind of HTML file. Or there is another way to do this

MSG
Hi manjeetgrang,

Are you using javascript to open your calendar page? If so you can use the following bit of script to pass the selected value of your calendar back to the parent page:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <script language="javascript">
  3. window.opener.document.getElementById('TextBox1').value = '<%=CalendarValue%>';window.close();
  4. </script>
  5.  
Simply run the above when your user has selected the date and you are ready to close the calendar pop-up.

Hope this helps,

Dr B
Jun 2 '08 #4
idsanjeev
241 100+
idsanjeev,

How will this help to pass the date value back to his original page? Unless I am missing something, using Session.LCID merely sets the Locale of your session to a particular location - in this instance Australian English. This can be useful for changing the format of dates, currencies etc that are displayed on your page.

Am I incorrect or have you perhaps misunderstood the original question?

Dr B

Hello DrBunchman
Right
when date selected in parent page and transfer to child then use of the code session LCID to convert date formate thats i am using when date was selected from javascripts and display on child
Jun 2 '08 #5
DrBunchman
979 Expert 512MB
Hello DrBunchman
Right
when date selected in parent page and transfer to child then use of the code session LCID to convert date formate thats i am using when date was selected from javascripts and display on child
If I understand you correctly then I do not believe that this answers the question that was being asked by the original poster.

However it is a useful piece of code to be aware of and can save a lot of time being able to change all date formats on a page with a single line. A full list of the Locale ID values can be found here.

Dr B
Jun 2 '08 #6
Hi Dr

i tried your code but still no result . Let me tell what i m doing as

I am doing like in my HTML Page

Expand|Select|Wrap|Line Numbers
  1.  
  2. <TD align=right><a href ="run.asp" target =" _blank "> Pickup date </a> <TD>
  3. <TD align='left"' width="25%"><INPUT name=Pickupdate></TD>
  4.  
Where hyperlink opens new window with calender in it
Pickupdate is to assigned the value from calendar which is in run.asp file.

and in my run.asp file i have code to design the calendar. There is function in run.asp file that assigns the current value to a inputbox to display selected date by user when user clicks on the date with
.
Expand|Select|Wrap|Line Numbers
  1. document.forms[1].dateField.value = dateStr;
Now i want to assign that date value which is in datestr in run.asp to pickupdate in HTML
Jun 2 '08 #7
DrBunchman
979 Expert 512MB
Try using the following snippet to open your new window then use the code I gave you earlier to return a value.
Expand|Select|Wrap|Line Numbers
  1. <a href="javascript:calendar_window=window.open('run.asp','calendar_window','width=280,height=240');calendar_window.focus()">Test</a>
  2.  
You don't need to specify the width and height parameters if you don't want to but for a calendar control it is useful to do so.

Let me know if you can get this to work.

Dr B
Jun 2 '08 #8
Hi Dr B

I am doing as you old me to do

Expand|Select|Wrap|Line Numbers
  1.  
  2. <TD align=right><a href="javascript:calendar_window=window.open ('run.asp','calendar_window','width=280,height=240');calendar_ window.focus ()">Test</a> 
  3. </td> 
  4. <script language="javascript">
  5. window.opener.document.getElementById('Pickupdate'). value = '<%=CalendarValue%>';window.close();
  6. </script>
  7. <TD align='left"' width="25%"><INPUT name=Pickupdate></TD>
  8.  
  9.  
but when i click on test nothing happens no window pops up from hyperlink


msg
Jun 2 '08 #9
DrBunchman
979 Expert 512MB
Maybe I haven't explained how to implement this very well.

On your first page:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <form name="TestForm">
  3.  <input type="text" name="TextBox1" />
  4.  <a href="javascript:calendar_window=window.open('Page2.asp','calendar_window','width=280,height=240');calendar_window.focus()">Test</a>
  5. </form>
  6.  
On your second page which I've called Page2.asp:
Expand|Select|Wrap|Line Numbers
  1.  
  2. <html>
  3. <head>
  4. <script language="javascript">
  5. function ReturnVal()
  6.      {
  7.      window.opener.document.getElementById('TextBox1').value = document.form2.TextBox2.value;window.close();
  8.      }
  9. </script>
  10. </head>
  11. <body>
  12.      <form name="form2">
  13.            <input type="text" name="TextBox2" onchange="ReturnVal();" />
  14.      </form>
  15. </body>
  16. <html>
  17.  
I've just tested this and it worked. Upon clicking the link the new window opened. After typing in the textbox then tabbing out from it the new window closed and returned the typed text to TextBox1. Can you try this out please and let me know if it works.

If it does then the next step is to change it for your own use. You'll need to edit the function ReturnVal() to return the date selected rather than the value of your textbox. You'll need to change the names of the pages and textboxes as appropriate as well.

Let me know how you get on,

Dr B
Jun 2 '08 #10
Hi Dr B

This 1 is working and i hope i will fix my problem now
MSG
Jun 2 '08 #11
Hi Dr B

This 1 is working and i hope i will fix my problem now
MSG

& Thanks Dr. B manjeet s grang
Jun 2 '08 #12
DrBunchman
979 Expert 512MB
No problem at all MSG, glad you got it working!

Dr B
Jun 2 '08 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: John MacIntyre | last post by:
Hi, I have a page with a series of child pages loaded into an iframe. When I move from page to page, I store an object containing the child's control data in a variable on the main page, then...
2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
6
by: stephan.vanbeerschoten | last post by:
Hi All, I am relatively new to MS Access but am wel suited in general relational databases. I seem to be unable to accomplish the displaying of query results that return more then one line item....
2
by: Curtis Justus | last post by:
Hi, I currently have a control that is on a form and I want to pass that exact instance of the control to another form (a child form that appears on a button click). The control has state,...
3
by: Hyrum Mortensen | last post by:
Hi, I want to have an asp:hyperlink (with target set to _blank) that points to a multi-field form a user would fill out. After submitting the form, I want to dynamically change the text of the...
1
by: Reinhold Mannsberger | last post by:
Hello I want to pass data from one page to another, more specifically I want to pass data from a child page to a parent page My parent page (parentpage.htm) does ----...
1
by: panche | last post by:
I'm developing a fairly simple user control that has two textboxes for date/time entry (a from date/time and a to date/time). One of my requirements is that there should be no button that sets...
1
by: | last post by:
Hi, 1st, I did a search and could not find any info on this, the Google results were good, but I'm still have issues...So any help will be great. I have a frame page, which contains 3 frames...
0
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.