Form programming in FrontPage 2003

A

alec

Hi guys,
I have already posted a question today but forgot to mention that instead of
using a BUTTON as input object, I would like to use a Hyperlink. And again,
all examples of code that I saw are incorporating a button. But how a code
would change if HYPERLINK is used to post the info entered to a Form text
boxes into an database.
Thank you for your help.
Alec
 
S

Stefan B Rusynko

The form object uses a button (submit) to initiate it's actions
- not a hyperlink
The action can send the user to another page (confirmation page)




| Hi guys,
| I have already posted a question today but forgot to mention that instead of
| using a BUTTON as input object, I would like to use a Hyperlink. And again,
| all examples of code that I saw are incorporating a button. But how a code
| would change if HYPERLINK is used to post the info entered to a Form text
| boxes into an database.
| Thank you for your help.
| Alec
 
M

MD Websunlimited

Alec,

It would not change, e.g.,

<form method="GET" action="mypage.asp" >
<input type="uid" name="uid" >
<input type="upw" name="upw"
<a class="submit" href="javascript:void(0);" onclick="this.form.submit();" >Submit Form</a>
</form>

Example mypage.asp would read the database then update the values:

dim uid
dim upw

firstname = request.form("uid")
if len(uid) = 0 then
firstname = request.querystring("uid")
if len(uid) = 0 then
call ShowError("User id field is required, please try again")
end if
end if
'
' Build db request
'
sSQL = "SELECT upw FROM users WHERE uid = '" & uid & "';"
set rs = rsOpen(sSQL)
if not rs.eof then
'get information
rsClose(rs)
sSQL = ....
else
' error msg.
call ShowError("Invalid User Id.")
....
end if

HTH,

--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 102 Components For FP
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible
Download the Trial http://www.microsoft.com/frontpage/downloads/addin/launchupdate/download.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top