473,231 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,231 software developers and data experts.

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 5677
....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
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
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
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
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
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
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
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
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
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
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.