passing fields from form to form, and handling a date field 
Author Message
 passing fields from form to form, and handling a date field

I have 2 forms on my page.  The first is used to select a date, as follows:

<td width="43%">
<form name=calform>
<input type=text name="eventdate" size=15>
<a href="javascript:show_calendar('calform.eventdate);"
onmouseover="window.status='Date Picker';return true;"
onmouseout="window.status='';return true;">
<img src="images/show-calendar.gif" width=24 height=22 border=0></a>
</td>

The second form provides entry of the remaining informaton, and passes the
values ot an asp page:

  <tr>
        <form method="post" onSubmit="return Validate(this);"
name="add_event" action="event_maint_post.asp">
        <input name="addEvent" type="hidden" value="1">
        <input name="eventdate" type="hidden">

    more form and html code

         <input type="submit" value="Add Event" name="AddEvent">
         <input type="reset" value="Reset Form" name="ResetForm"></p>
        </form>
       </td>
      </tr>

Questions:
In the example above, how to I put the value of "eventdate" from the first
form into the second form.  I do a response.write in the asp page and the
variable is not being passed.

Do I need to convert this value into a date type field in order to insert it
(using a sql insert) into an Access table, where it will be defined as a
date data type?

Thanks,
Greg



Sat, 26 Apr 2003 03:00:00 GMT  
 passing fields from form to form, and handling a date field

<form method="post" onSubmit="return Validate(this);"
 name="add_event" action="event_maint_post.asp">
         <input name="addEvent" type="hidden" value="1">
         <input name="eventdate" type="hidden">

     more form and html code...

<input type="submit" value="Add Event" name="AddEvent"
onclick="document.add_event.eventdate.value=document.calform.eventdate.value;return true">
<input type="reset" value="Reset Form" name="ResetForm"></p>
         </form>

Tim.

Quote:

> I have 2 forms on my page.  The first is used to select a date, as follows:

> <td width="43%">
> <form name=calform>
> <input type=text name="eventdate" size=15>
> <a href="javascript:show_calendar('calform.eventdate);"
> onmouseover="window.status='Date Picker';return true;"
> onmouseout="window.status='';return true;">
> <img src="images/show-calendar.gif" width=24 height=22 border=0></a>
> </td>

> The second form provides entry of the remaining informaton, and passes the
> values ot an asp page:

>   <tr>
>         <form method="post" onSubmit="return Validate(this);"
> name="add_event" action="event_maint_post.asp">
>         <input name="addEvent" type="hidden" value="1">
>         <input name="eventdate" type="hidden">

>     more form and html code

>          <input type="submit" value="Add Event" name="AddEvent">
>          <input type="reset" value="Reset Form" name="ResetForm"></p>
>         </form>
>        </td>
>       </tr>

> Questions:
> In the example above, how to I put the value of "eventdate" from the first
> form into the second form.  I do a response.write in the asp page and the
> variable is not being passed.

> Do I need to convert this value into a date type field in order to insert it
> (using a sql insert) into an Access table, where it will be defined as a
> date data type?

> Thanks,
> Greg



Sat, 26 Apr 2003 03:00:00 GMT  
 passing fields from form to form, and handling a date field
Cool, thanks Tim.  Once again you come to my rescue!

That worked, now I am over on the page that performs the update.  The
following SQL produceds the string listed below.

sqlString = "INSERT INTO EventSchedule(Event_Date, Event_Location,
Event_Website)"
sqlString = sqlstring & "VALUES('" & EventDate  & "',"
sqlString = sqlString & " '" & EventLocation  & "',"
sqlstring = sqlstring & "  " & EventWebsite  & ")"

INSERT INTO EventSchedule(Event_Date, Event_Location,
Event_Website)VALUES('11/11/2000', 'test 1', www.test.com)

And that results in this error:

Microsoft JET Database Engine error '80040e10'
No value given for one or more required parameters.
/maint/event_maint_post.asp, line 64

I verified that my field names are spelled correctly.  Therefore I suspect
the date field.  Right now the variable being passed with the event date
begins life as a text input field.  In the database, it is type date/time.
Is there a conversion that a field must be subjected to before stuffing it
into a date/time field?

Thanks,
Greg


Quote:
> <form method="post" onSubmit="return Validate(this);"
>  name="add_event" action="event_maint_post.asp">
>          <input name="addEvent" type="hidden" value="1">
>          <input name="eventdate" type="hidden">

>      more form and html code...

> <input type="submit" value="Add Event" name="AddEvent"

onclick="document.add_event.eventdate.value=document.calform.eventdate.value
;return true">
Quote:
> <input type="reset" value="Reset Form" name="ResetForm"></p>
>          </form>

> Tim.


> > I have 2 forms on my page.  The first is used to select a date, as
follows:

> > <td width="43%">
> > <form name=calform>
> > <input type=text name="eventdate" size=15>
> > <a href="javascript:show_calendar('calform.eventdate);"
> > onmouseover="window.status='Date Picker';return true;"
> > onmouseout="window.status='';return true;">
> > <img src="images/show-calendar.gif" width=24 height=22 border=0></a>
> > </td>

> > The second form provides entry of the remaining informaton, and passes
the
> > values ot an asp page:

> >   <tr>
> >         <form method="post" onSubmit="return Validate(this);"
> > name="add_event" action="event_maint_post.asp">
> >         <input name="addEvent" type="hidden" value="1">
> >         <input name="eventdate" type="hidden">

> >     more form and html code

> >          <input type="submit" value="Add Event" name="AddEvent">
> >          <input type="reset" value="Reset Form" name="ResetForm"></p>
> >         </form>
> >        </td>
> >       </tr>

> > Questions:
> > In the example above, how to I put the value of "eventdate" from the
first
> > form into the second form.  I do a response.write in the asp page and
the
> > variable is not being passed.

> > Do I need to convert this value into a date type field in order to
insert it
> > (using a sql insert) into an Access table, where it will be defined as a
> > date data type?

> > Thanks,
> > Greg



Sat, 26 Apr 2003 03:00:00 GMT  
 passing fields from form to form, and handling a date field

You are using Access, the date must be between #, not ' (Read the FAQ)

Also, include the URL in single quotes.

--

Kind regards

Sven Aelterman
IT
Global Communication N.V.

Remember: Bugs come in through Windows.

http://www.aelterman.com
http://www.my-it.org


Quote:
> Cool, thanks Tim.  Once again you come to my rescue!

> That worked, now I am over on the page that performs the update.  The
> following SQL produceds the string listed below.

> sqlString = "INSERT INTO EventSchedule(Event_Date, Event_Location,
> Event_Website)"
> sqlString = sqlstring & "VALUES('" & EventDate  & "',"
> sqlString = sqlString & " '" & EventLocation  & "',"
> sqlstring = sqlstring & "  " & EventWebsite  & ")"

> INSERT INTO EventSchedule(Event_Date, Event_Location,
> Event_Website)VALUES('11/11/2000', 'test 1', www.test.com)

> And that results in this error:

> Microsoft JET Database Engine error '80040e10'
> No value given for one or more required parameters.
> /maint/event_maint_post.asp, line 64

> I verified that my field names are spelled correctly.  Therefore I suspect
> the date field.  Right now the variable being passed with the event date
> begins life as a text input field.  In the database, it is type date/time.
> Is there a conversion that a field must be subjected to before stuffing it
> into a date/time field?

> Thanks,
> Greg



> > <form method="post" onSubmit="return Validate(this);"
> >  name="add_event" action="event_maint_post.asp">
> >          <input name="addEvent" type="hidden" value="1">
> >          <input name="eventdate" type="hidden">

> >      more form and html code...

> > <input type="submit" value="Add Event" name="AddEvent"

onclick="document.add_event.eventdate.value=document.calform.eventdate.value

- Show quoted text -

Quote:
> ;return true">
> > <input type="reset" value="Reset Form" name="ResetForm"></p>
> >          </form>

> > Tim.


> > > I have 2 forms on my page.  The first is used to select a date, as
> follows:

> > > <td width="43%">
> > > <form name=calform>
> > > <input type=text name="eventdate" size=15>
> > > <a href="javascript:show_calendar('calform.eventdate);"
> > > onmouseover="window.status='Date Picker';return true;"
> > > onmouseout="window.status='';return true;">
> > > <img src="images/show-calendar.gif" width=24 height=22 border=0></a>
> > > </td>

> > > The second form provides entry of the remaining informaton, and passes
> the
> > > values ot an asp page:

> > >   <tr>
> > >         <form method="post" onSubmit="return Validate(this);"
> > > name="add_event" action="event_maint_post.asp">
> > >         <input name="addEvent" type="hidden" value="1">
> > >         <input name="eventdate" type="hidden">

> > >     more form and html code

> > >          <input type="submit" value="Add Event" name="AddEvent">
> > >          <input type="reset" value="Reset Form" name="ResetForm"></p>
> > >         </form>
> > >        </td>
> > >       </tr>

> > > Questions:
> > > In the example above, how to I put the value of "eventdate" from the
> first
> > > form into the second form.  I do a response.write in the asp page and
> the
> > > variable is not being passed.

> > > Do I need to convert this value into a date type field in order to
> insert it
> > > (using a sql insert) into an Access table, where it will be defined as
a
> > > date data type?

> > > Thanks,
> > > Greg



Sun, 27 Apr 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Making hidden fields visible based on a form field value

2. Dynamic form field handling

3. passing form fields: lost when going to frame

4. VBscript passing data into a hidden form field?

5. Pass values from FORM fields to another page without a SUBMIT action

6. passing a form field value from a page to a frame's page

7. Compare date in form with date/time in form with date/time in database

8. Clearing fields on a form

9. 2nd Post: IFRAME DIVs and form fields

10. IFRAME DIVS and hidden form fields

11. Newbie - Access to form fields

12. how to handle NULL values from a FORM when using date string functions - help please

 

 
Powered by phpBB® Forum Software