retreive values comming from a javascript

Posted on 2013-10-10
Medium Priority
Last Modified: 2013-10-17
Hi Experts,

I've found a clalendar script that is doing exactly what I need.
But I don't understand how to retreive the selected values. Normaly in classisc ASP I use
something like


Open in new window

The script beneath is a sniplet of a bigger file from Github:

function submitByDates(fm) {	// construct the selected dates in the hidden form field allSelected
	var dl=document.getElementById("dateList");
	var dateItems="";
	for (var i=0; i < dl.length; i++) {
		if (i>0) dateItems+=",";
	// fm.action="ByDate.php";
	alert(dateItems); // in your app you should call fm.submit() instead so that the allSelected.value can be submitted.

Open in new window

Can someone please help to reteive these values captured in the form in classic ASP?
Question by:Steynsk
  • 4
  • 2
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39562152
The good news is when you click a calendar and get the pop up then select a date, it throws thd data in the form text box.  At least that is what I see here http://www.calendarxp.net/tt_pop.shtml

Once the data is in the form text box, you will retrieve it as normal with your request.form once you click the form submit button.
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39562160
That calendar script is old as it references ie5.5  I had a hard time using it on chrome browser in the month view http://www.calendarxp.net/scripts/MockupSibling/dhtmlgoodies-week-planner.php?initDate=2013-10-13

I have been using fullcalendar http://arshaw.com/fullcalendar/ for my projects and it works nicely.  There is a learning curve with any of these if you are not used to javascript or jquery.

The key thing to remember is your asp code runs before the page is even rendered on the server (asp is a server side language).  Javascript/jquery is typically a client side language meaning it runs on your computers browser after the page loads.  

This means you can use your asp to add data to javascript/jquery if needed, but not the other way around.

Author Comment

ID: 39562413
Dear Padas,
THank you for your quick response. I know the ASP is server based but the script still functions in the, by the ASP generated, HTML output . And klicking the dates makes the dates appear in my multiple select box.

Is there no way I can post these valus to my post proccessing code?

And yes the code is older but I don't have problems in Chrome. And I could not find a year view of the fullcalendar script. I need to be able making selections in a full year view.

Kind regards
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

LVL 54

Accepted Solution

Scott Fell,  EE MVE earned 2000 total points
ID: 39562814
It was the full month calendar I had an issue with. I can see it, but editing was a problem.

With fullcalendar, you can do a year view simply by making 12 small month calendar.

To answer your question about submitting the date chosen, when you use the pop up calendar for instance, you click on a date and the date is populated to the form field.  I am looking at this sample http://www.calendarxp.net/tt_pop.shtml.  From there, you just submit your form as normal.  

In the first example of the link I just provide, the form field is
<input name="startDateCtrl" value="" size="11" maxlength="8" class="plain" alt="start date">

Open in new window

Since the name of the field is startDateCtrl, you would access it with request.form("startDateCtrl").

Maybe you should just build yourself a sample page of how you would use this and provide a link and we can get to more real life example.

Another option is jquery ui calendar.
Default as a pop up http://jqueryui.com/datepicker/
Display inline without pop up http://jqueryui.com/datepicker/#inline
Multiple Months http://jqueryui.com/datepicker/#multiple-calendars

I have not looked through the code of the calendar you chose, but the reason I suggest fullcalendar or jquery ui calendar is because they are going to target modern browser and they also have a more up to date look.  They are similar to  calendarxp as they are generated by js.  

With any of these, the calendar is generated by js and your data to fill the calendar such as events is going to be via your asp code.  With calendarxp, it looks like you use xml.  With the others you can use json as well.

Author Closing Comment

ID: 39579306
Thanks Padas,

I've got a working jquery UI cript supporting multiple selects. It works very smoothly.

Kind regards,
LVL 54

Expert Comment

by:Scott Fell, EE MVE
ID: 39581211
Great to hear! I am glad you have a good solution.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question