473,480 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How do I submit form data and change to a different page?

Probably a fairly simple problem but one that's been plaguing me for a
couple of days... can anyone help?

I have a classic ASP page with a number of text boxes which are updatable.

For convenience I want to add 'tabs' at the top of the page (like a card
index) as the data to be displayed is split into specific groups (client,
company, preferences, events).

How do I update any changes to the data and switch to a different page - at
the same time? i.e. the user doesn't have to click 'update' (submit button)
before changing pages

Sample code is below...

Thanks in advance
Simon

Sample code:
<table width=785 height="430" border="1" bordercolor="#FFFFCC"
style="border-collapse: collapse"><tr>
<td height="20">
<!-- simple tabs -->
<a href="contacts.asp?id=<% =request("id") %>" >Client details</a>&nbsp;
¦&nbsp;
<a href="contacts.asp?page=events&id=<% =request("id") %>" >Event
Enquiries</a>&nbsp; ¦&nbsp;
<a href="contacts.asp?page=mailing&id=<% =request("id") %>" >Mailing
Preferences</a>&nbsp; ¦&nbsp;
<a href="contacts.asp?page=company&id=<% =request("id") %>" >Company
Information</a></td></tr><tr>
<td height="410" bgcolor="#FFFFCC" valign="top">
<table border="0" width="785" height="410">
<tr>
<td valign="top" height="390">
<table border="0" width=785>
<tr>
<td>
<!-- start of form -->
<form action=contacts.asp method=post name=form1>
<input type=hidden name=id value=<% =request("id") %>>
<input type=hidden name=page value=<% =request("page") %>>
<input type=hidden name=show value=<% =Request.Cookies("adminshow") %>>
<input type=hidden name=companyid value=<% =oRS("companyid") %>>

<div align="center">
<table border=0 width=782 height=395>
<tr>
<td width="340" valign="top">
<table border="0" width="100%">
<tr>
<td width="100" align="right">title</td>
<td width="10" align="right">&nbsp;</td>
<td width="230"><select size="1" name="title">
<option>-</option>
<option selected><% =oRS("title") %></option>
<option>Mr</option>
<option>Mrs</option>
<option>Miss</option>
<option>Ms</option>
<option>Dr</option>
</select></td>
</tr>
<tr>
<td width="100" align="right">first name</td>
<td width="10" align="right">&nbsp;</td>
<td width="230">
<input type="text" name="name" size="25" value='<% =oRS("name")
%>'></td>
</tr>
....
<!-- more form fields here -->
</table>
</td>
</tr><tr><td colspan="3" height="195">
<p align="center">
<textarea rows="10" name="callbacknote" cols="92"><%
=oRS("callbacknote") %></textarea></td>
</td></tr>
</table>
</div>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr><div align=center>
<a href="index.asp?page=callbacks&show=<% =varID %>">back</a>&nbsp;
<input type="submit" value=" update " name="update">
<input type="button" value=" copy " name="B4"
onclick="recordcopy()">
<input type="button" value=" delete " name="B5"
onclick="recorddelete()">
<input type="button" value=" print " name="B6"
onclick="recordprint()">
</div>

Apr 1 '07 #1
5 5688
....have you thougt about making the tabs to (additional) submit-buttons?! As
far as i can see all tabs are directing to the same page. If this isn't
possible you might consinder using Javascript to modfiy target (and data) of
the form (depeding on the tab clicked) and then using Javascript to simulate
a button click.

ciao, Mike
Apr 1 '07 #2
HI Mike,

Possible I didn't explain myself...

Yes I want to find some javascript (that works unlike mine) that will - from
the onClick property of the HREFs - trigger form submit - I thought it was
myForm.submit() - and then load the alternate page in such a way that it
doesn't matter which link tab has been clicked - I need to store the data
each time a page has been changed as this is the prototype for a large
multi-user system which could have a number of users dependent upon the
data!

Effectively I need a text link which triggers an onClick update of the
database, plus a redirect to the relevant page (actually an include file
within a container) and I've tried all that I can think of without success!

TIA
Simon
"M. Agel" <mi**@eldea.dewrote in message
news:57*************@mid.individual.net...
...have you thougt about making the tabs to (additional) submit-buttons?!
As far as i can see all tabs are directing to the same page. If this isn't
possible you might consinder using Javascript to modfiy target (and data)
of the form (depeding on the tab clicked) and then using Javascript to
simulate a button click.

ciao, Mike
Apr 1 '07 #3
Simon Benson wrote on 01 apr 2007 in
microsoft.public.inetserver.asp.general:
Yes I want to find some javascript (that works unlike mine) that will
- from the onClick property of the HREFs - trigger form submit - I
thought it was myForm.submit() - and then load the alternate page in
such a way that it doesn't matter which link tab has been clicked
What is a link tab?
A tab like in FF or IE7?

What is an "onClick property of the HREFs"?
Do hrefs have onclick properties? I doubt that.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Apr 1 '07 #4

"Simon Benson" <si***********@googlemail.comwrote in message
news:RI****************@newsfe6-gui.ntli.net...
Probably a fairly simple problem but one that's been plaguing me for a
couple of days... can anyone help?

I have a classic ASP page with a number of text boxes which are updatable.

For convenience I want to add 'tabs' at the top of the page (like a card
index) as the data to be displayed is split into specific groups (client,
company, preferences, events).

How do I update any changes to the data and switch to a different page -
at the same time? i.e. the user doesn't have to click 'update' (submit
button) before changing pages

Sample code is below...

Thanks in advance
Simon
1. Use something besides an a[nchor] tag for the tabs, like a button or a
span -- i.e., something for which the built-in click behavior doesn't
implicitly navigate to another document. Most element types support the
onclick event, and all of the anchor element's UI effects (cursor,
roll-over, etc) can be implemented for any element using CSS.

2. Set the action attribute of the form element dynamically in the tab click
procedure, before calling its submit method.

That way the form submit will navigate to the appropriate script, without
any interference from the behavior of an anchor.
-Mark
Sample code:
<table width=785 height="430" border="1" bordercolor="#FFFFCC"
style="border-collapse: collapse"><tr>
<td height="20">
<!-- simple tabs -->
<a href="contacts.asp?id=<% =request("id") %>" >Client details</a>&nbsp;
¦&nbsp;
<a href="contacts.asp?page=events&id=<% =request("id") %>" >Event
Enquiries</a>&nbsp; ¦&nbsp;
<a href="contacts.asp?page=mailing&id=<% =request("id") %>" >Mailing
Preferences</a>&nbsp; ¦&nbsp;
<a href="contacts.asp?page=company&id=<% =request("id") %>" >Company
Information</a></td></tr><tr>
<td height="410" bgcolor="#FFFFCC" valign="top">
<table border="0" width="785" height="410">
<tr>
<td valign="top" height="390">
<table border="0" width=785>
<tr>
<td>
<!-- start of form -->
<form action=contacts.asp method=post name=form1>
<input type=hidden name=id value=<% =request("id") %>>
<input type=hidden name=page value=<% =request("page") %>>
<input type=hidden name=show value=<% =Request.Cookies("adminshow") %>>
<input type=hidden name=companyid value=<% =oRS("companyid") %>>

<div align="center">
<table border=0 width=782 height=395>
<tr>
<td width="340" valign="top">
<table border="0" width="100%">
<tr>
<td width="100" align="right">title</td>
<td width="10" align="right">&nbsp;</td>
<td width="230"><select size="1" name="title">
<option>-</option>
<option selected><% =oRS("title") %></option>
<option>Mr</option>
<option>Mrs</option>
<option>Miss</option>
<option>Ms</option>
<option>Dr</option>
</select></td>
</tr>
<tr>
<td width="100" align="right">first name</td>
<td width="10" align="right">&nbsp;</td>
<td width="230">
<input type="text" name="name" size="25" value='<% =oRS("name")
%>'></td>
</tr>
...
<!-- more form fields here -->
</table>
</td>
</tr><tr><td colspan="3" height="195">
<p align="center">
<textarea rows="10" name="callbacknote" cols="92"><%
=oRS("callbacknote") %></textarea></td>
</td></tr>
</table>
</div>
</tr>
</table>
</td>
</tr>
<tr><td>
<hr><div align=center>
<a href="index.asp?page=callbacks&show=<% =varID %>">back</a>&nbsp;
<input type="submit" value=" update " name="update">
<input type="button" value=" copy " name="B4"
onclick="recordcopy()">
<input type="button" value=" delete " name="B5"
onclick="recorddelete()">
<input type="button" value=" print " name="B6"
onclick="recordprint()">
</div>

Apr 1 '07 #5

"Simon Benson" <si***********@googlemail.comwrote in message
news:RI****************@newsfe6-gui.ntli.net...
Probably a fairly simple problem but one that's been plaguing me for a
couple of days... can anyone help?

I have a classic ASP page with a number of text boxes which are updatable.

For convenience I want to add 'tabs' at the top of the page (like a card
index) as the data to be displayed is split into specific groups (client,
company, preferences, events).

How do I update any changes to the data and switch to a different page -
at
the same time? i.e. the user doesn't have to click 'update' (submit
button)
before changing pages

Sample code is below...

Thanks in advance
Simon
Are you sure you want to update data when switching between tabs? What
happens of the user doesn't complete filling in stuff on the other tabs?
How does the user indicate they have finished entering their data?

Would it be more preferable simply to let the user navigate between tabs as
they like without submitting any data and have a single submission of the
data when they are happy with it?

Apr 3 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
3030
by: Matt | last post by:
I want to submit the form to the server without opening another page. When we do the following, it will submit the form data in myform to the IIS, and open page2.asp. <form name="myform"...
3
2064
by: Matt | last post by:
When people say submit the form data, does it mean the form data are submitted to web browser using either HTTP GET or POST method, and then it will redirect to another page. For example, this...
2
73343
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
6
3063
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
1
2253
by: ed_spain | last post by:
Hi Everyone, On an HTML page with 2x different forms, how can I redisplay the same page after a submit, restoring the values from BOTH forms even though only one was submitted? I have an...
9
1954
by: Eric George | last post by:
Hi, Has anyone had any success using jscript submit method in their VS.NET projects? For example I have some client processing in a script function then call <form name>.submit(); This won't...
7
2339
by: David T. Ashley | last post by:
Hi, For a web page, I want a SUBMIT button that commits the form data and a CANCEL button that goes to a different target (i.e. a different script). I haven't figured out how to do this,...
4
5493
by: j1dopeman | last post by:
Hi, I'd like to use a button to save and then submit a form. I can set the onlick of the button to mahButton_click or submit, but I can't figure out how to do both. It looks like c# can't...
5
10299
by: Rider | last post by:
Hi All, Here is the reason why i ak asking for ur help. I have a edit form in which the values already stored in DB are populated. User can edit some or all the values in the form. then he...
0
7039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6735
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6895
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.