473,386 Members | 1,726 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,386 software developers and data experts.

Passing value of a button thats not a Submit button

Hi all,

I have an asp page with a delete button which has an OnClick Ok/Cancel
msgbox event. My problem is that in order to run the Onclick event
i've chaged the buttons type from "Submit" to "Button" - and now the
buttons value (which i need in the next page) is not passed in the
URL.

This is what i have tried to do:

<SCRIPT language="VBScript">
Sub btnDelete_onClick()
returnvalue=MsgBox ("Are you sure you want to delete this document
from the intranet?", VBOKCancel)
If returnvalue = 1 then
fmPressReleaseFields.action = "report.asp?btnDelete=Delete"
fmPressReleaseFields.submit()
end if
End Sub
</SCRIPT>

but for some reaseon the ?btnDelete=Delete part of the url is not
passed, possibly beacuse there are other values i'm passing that are
overwriting it(?)

Can anyone thing of a way to pass the butons value??

Thanks in advance.
Jul 19 '05 #1
3 1713
Are you reading the data from the querystring and not from the form
collection on the server? Is fmPressReleaseFields assigned to the form?

An alternative would be to assign the value in a hidden field instead of
adding the value to the querystring and then submit the form.

BTW client side VB script is only supported by IE. You will have bigger
chance to get a crossbrowser solution if you use javascript if that matters
for you.

Regards
/Hans
Jul 19 '05 #2
Cheers,

It's an inranet asp site so i know everyone will be using IE.

fmPressReleaseFileds is the name of the form.

I guess i'm reading the data from thr collection on the server - i'm
just using Request("xyz") on the next page to collect the values.

I considered using a hidden field to pass the value, but the problem
with that is that i have several buttons on the page (Save, Delete and
cancel) and the hidden field would be submitted whichever button is
pressed - which would mess up the next page.

Maybe - is there a way to only submit the hidden field id the delete
button is pressed? Or to set the value of the hidden field in vbscript
OnClick event?


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
Ah, I've just answerd my own question.

I added hidden field in named 'hdnDelete' and also added a line to the
OnClick event

fmPressReleaseFeilds.hdnDelete.value = "Delete"

Then on the next page when i say:

If Request("btnDelte")...

i wrote

If Request("btnDelete") or Request("hdnDelete")...

The answer is always much easyer than your expect!

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

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

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
1
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p...
11
by: HolaGoogle | last post by:
Hi, Sorrryy to ask such basic question but i do need your help! Here's what i'm trying to do: In my parent form i'm calling a my Iframe form to get certain value, then depending on that value...
2
by: Les Peabody | last post by:
Hello. I'm a rookie ASP VBScripter and am having a difficult time scripting the following scenario: I have an index.asp file that has a multi-line text box and a button of type button. When...
5
by: Steve | last post by:
Hi, I currently have a problem passing a variable value from one page to another. Once a form submit button is pressed java pops up a window and displays some information. The problem being is...
1
by: satish2112 | last post by:
Hi, I have a text-area which contains values from mysql database and 2 buttons, Edit and Update. When I click on the Edit button, I can edit the text-area (initially non-editable). After this,...
8
by: ridgedale | last post by:
I wonder if anyone could explain how I pass the field values in my request form to the PHP processor page. My external javascript file is as follows: var sections = ; for (var i=0; i <...
5
by: Fran Jakers | last post by:
Hello all, I'm new to all this and I could really use some help. I've searched the web but cannot find an answer. I have an HTML form with 3 radio buttons and a search field that calls a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.