?
Solved

submit on date selection

Posted on 2004-10-01
7
Medium Priority
?
243 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 800 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…
Suggested Courses

770 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