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.

Re: Passing value of a button thats not a Submit button by Hans

Hans
Wed Jun 09 07:00:34 CDT 2004

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