Solved

submit on date selection

Posted on 2004-10-01
7
239 Views
Last Modified: 2008-02-01
I am using java script for date picker.  What I would like to happen is that when the date is selected, instead of just passing the new date back to the form, I would like for it to continue on to a new page where that date has been passed as a variable.  i

Here is the code that I am using on my asp page for the date picker.

  <tr>
    <td width="12" background="steel.gif"><font face="Tahoma" size="2"><img border="0" src="l_32.gif" width="12" height="32"></font></td>
    <td width="448" background="steel.gif" colspan="4"><font face="Tahoma" size="2">When will this start?</font>
      <FORM NAME=DATE1 ><INPUT type=text name=date1 value='<%=right("0" & Month(Date()),2) & "/" & right("0" & Day(Date()),2) & "/" & Year(Date())%>'
                      onchange="javascript:cbfloadmefirst('form1', 'date1');" size="20">
      <INPUT id=btn1 type=button value='Calendar' onclick="javascript:cbfshowcalendar('FMLFOR', 'date1', 'btn1');event.cancelBubble=true;">
   </FORM>
    </td>
    <td width="448" background="../images/2004/bg_steel.gif" colspan="4"><font face="Tahoma" size="2">
   </tr>
0
Comment
Question by:Chuck_aa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 9

Expert Comment

by:riyasjef
ID: 12204084

change the code


<INPUT id=btn1 type=button value='Calendar' onclick="javascript:cbfshowcalendar('FMLFOR', 'date1', 'btn1');event.cancelBubble=true;">

to


<INPUT id=btn1 type=button value='Calendar' onclick="javascript:cbfshowcalendar('FMLFOR', 'date1', 'btn1');event.cancelBubble=true;this.form.submit();">

Riyasjef

0
 
LVL 9

Expert Comment

by:riyasjef
ID: 12204187
You have to change the form "action" to appropriate page
0
 
LVL 63

Accepted Solution

by:
Zvonko earned 200 total points
ID: 12204211
Use this extended function:

function cbfselectdate(objid)
{
     var tmpobj;
     var d=eval("document.all." + objid + ".value");
     var m=parent.document.frames.CalFrame.document.fx.txtmth.value;
     var y=parent.document.frames.CalFrame.document.fx.txtyrs.value;
     var objname=parent.document.frames.CalFrame.document.fx.txtobj.value;
     var frmname=parent.document.frames.CalFrame.document.fx.txtfrm.value;
     
     if (d!="")
     {
     cbfdrawcalendar(d,m,y);
     parent.document.frames.CalFrame.document.fx.txtday.value=d;
     
     tmpobj=eval("parent.document." + frmname + "." + objname);
     newdate=m+"/"+d+"/"+y;
     tmpobj.value=newdate;
     
     parent.document.all.CalFrame.style.display="none";
     parent.document[frmname].submit();  // this line added
     }
}

0
 

Author Comment

by:Chuck_aa
ID: 12204589
Zvonko!  You are brilliant!!!!!!!!!!!!!  but ofcourse I have another question for you....  so I added that line to the code and it brought me back to the page with the date selected.... but where do I enter the page that I want it to go to and the additional variables?
0
 

Author Comment

by:Chuck_aa
ID: 12204614
I do want it to go back to the same page... but I need to add on to the query string a few more variables....
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Review of the nodejs code 1 38
How to escape unsafe HTML tags 4 36
Sending ASP to server side 8 33
Can't get js code to execute 8 32
This article discusses how to create an extensible mechanism for linked drop downs.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

730 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