PDA

View Full Version : flash button to pass a value using javascript


ooiooipig
04-14-2003, 07:39 AM
Hi all, can anyone advise me on how do I go about using a flash button to pass a value to the next page using javascript??

Now I need to pass the reference number to the next page for it to identify itself from the database and to retrieve the correct informations to be displayed out in the page.

Please advise!! thanks alot!!

david7777
04-14-2003, 08:39 AM
There are two ways to do this:

1:

<form name="myForm">
<input name = "reference" type="hidden" value = "234">
</form>
... Flash Button Object ...

In the above example, you will need to make the link on the flash button: window.document.myForm.submit()
So in the hidden form elements, you will have the value to pass to the next page...

the second way uses ASP, so if you know ASP, tell me and Ill let you know...

:cool:

ooiooipig
04-15-2003, 02:07 AM
yah david, i've learnt asp before... so how should i go about doing it?

david7777
04-15-2003, 10:40 AM
ok- first of all I need to know some stuff:
Where is this reference number taken from? Is it from a form, javascript, ASP?

Basically, you will need to create a link with the queryStrings in it. So for example:
You can have a javascript function:

<script>
function createLink(ref){
var link;
// The link template plus the reference number
link = "./nextLink.asp?reference=" + ref;
// Make the browser go to the link
location.href=link;
}
</script>

There could be a better way of doing it depending where the reference number is coming from...

So let me know

:cool:

ooiooipig
04-16-2003, 07:08 AM
the reference number is generated in the asp page before it is being insert into the database...

david7777
04-16-2003, 08:32 AM
Oh ok - then its quite easy...

Say you have your autogenerated ref number as a variable called "ref"
ie:

<%
dim ref
ref = 123
%>

Now you can work with that and stick it in a link as follows:

<a href="./pages/nextPage.asp?reference=<%=ref%>">Click here to continue!</a>

Or you could automatically redirect the page by saying:

<%
response.redirect("./pages/nextPage.asp?reference=" & ref)
%>

You could use it anywhere you would normally use a link.
:cool:

ooiooipig
04-16-2003, 09:58 AM
ok thanks alot david!!