Image Swap Using Asp Variables And Javascript

I have 1 large image and small 3 thumbnails. Whenever a user clicks a thumbnail, it swaps with the large image. This, of course, is very straight forward when just including the directory and filename of the image in the Javascript. However, my images are sourced from an Access database (using the directory path of the image as a text field). I would like to insert the ASP <%=rs(?FieldName?)%> or variable within the Javascript so that it pulls the images from the db. I have tried this but it does not work.

I guessing that it has something to do with conflict between client and server side coding. I have included a snippet of the code. There seems to be nothing amiss with the source code. Can you help?

//javascript function
<script type="text/javascript" language="javascript">
function swapPhoto(photoSRC) {
document.images.imgPhoto.src = photoSRC;
//swap thumbnail pics with main pic
}
</script>

<!--Main large image-->

.....

View Replies


ADVERTISEMENT

Swap Image

I'm having a problem with a script.When a customer upload their picture I would like for them to place there picture on a t-shirt for example.what script can I use for this purpose?

View Replies View Related

Asp Guestbook Image Swap Help

Ok say a person puts their email into my guestbook example (joe@joe.com). Well i want to take the person's email and convert it to an image when they post it.

here is the code for the email anyone know how to do it?
<a
href="mailto%= CmdShowEntries("EMAIL") %>"><%= CmdShowEntries("EMAIL") %></a>

View Replies View Related

How Do I Swap Variable In ASP For An Image

how to swap a variable which comes from an xml feed for an image instead using ASP. I will explain in a bit more detail what I mean:

My variable is called strOperator and is supplied as a 3 letter code from the xml feed i.e ABC, CDE, DEF for different operators (each with their own associated 3 letter code).

What I want to do is instead of displaying my results with the code it would be more meaningful to display an image instead for each associated operator. (each operator has their own image).

View Replies View Related

Javascript Variables

How can i convert a variable from javascript to vbscript or update an SQL record set with a javascript variable?

View Replies View Related

Variables Within Javascript

I read (probably on here) how to set javascript variables equal to ASP variables

(var NONE='<%=NONE%>') or equivalently

(var NONE='<%response.write(NONE)%>')

Why do you need the single quotes. How does the quote render within the javascript?

View Replies View Related

Variables Between Javascript And ASP

how i can pass a variable from my JavaCsript function to my ASP function. I have a list from which I call a javascript function with onChange(javascript function). Inside that function, i want to pass a variable to an ASP function which will use it in a SQL query.

I have tried everything i can imagine but to no avail. If that is not possible does anyone know how i can accomplish this in another way? I mean. can i call the ASP function directly from my onChange(asp function)? Or does an onChange require a script?

View Replies View Related

Image Button And Javascript

I've an asp:Imagebutton on my form with the visible property set to false

<asp:Imagebutton ID="tstImage" runat=Server visible=False>

How can I set the visible propery to true using a javascript ?
I tried something like document.GetElementById('ImgTest').visible='true';
but without succes ....

View Replies View Related

Passing Variables Between ASP And Javascript

I am using ASP to open a text file on the server and I want to pass
variables to Javascript. Any suggestions?

For example - I have a text file on the server defining a set of pictures.
I open the text file to retrieve the list of files. I want to pass the list
of files to the Javascript which will then display the data on the client
machine.

View Replies View Related

Passing ASP Variables With Javascript ??

I have a web site completely developed with .html pages.

My affiliate and ecommerce system are written in asp, as is the only registration page (register.asp).

If an affiliate sends a visitors to our registration page and the user decides to browse the site before registering we lose track of the affiliate id variable..

..Is there a way to pass a (one) variable between the html pages as the visitor browses the html based site and then have it passed to the registration page (register.asp)?

Also is there a method to set a cookie that retains this variable, and have it set to a one week expiration so that when the visitor returns to the site the most recently refering affiliate gets credit.

If passing of the variable is possible with javascript, can the javascript automatically check for the existence of the aforementioned cookie?

View Replies View Related

Javascript Update Asp Variables

I know you can enter asp variable values into javascript functions

javascript_function(<%=asp_variable%>);

But can it go the other way? Can I take results from a javascript function and use them to update an asp variable? I would like to do the updating inside the function because it will be an onclick function.

View Replies View Related

Assign Javascript Variables To ASP (VbScript)

Is it possible to assign javascript variables values to ASP?

e.g. How would I store the following JS variable as an ASP variable in VBScript?

<script type="text/javascript">
var intJavaScriptNumber = 25;
</script>

The problem is I've got about 50 of these variables on a page, and they all need to be used in a simple equation which slows the browser down. If I could get them all into ASP then I could process this server side much more comfortably.

View Replies View Related

Passing Variables Between ASP Scripts And Javascript?

Has anyone had success passing variable data between ASP scripts and Javascript?

View Replies View Related

Can Asp Swap Images This Way?

This is my scenario...I have three images that I want to put on a website that will change to one another constantly. There will be three table columns on the top that indicate what the available three images are. If the user's mouse hovers over one of the table cells, the image will immediately change to what the table cell corresponds, and the user will be able to click on either the table cell or the image to go to another website.

I have included an image to better illustrate what I am talking about.
image

What is the best scripting language to do this? javascript, css, asp, flash?
All of the above seems hard to me, especially the last two....

View Replies View Related

Javascript Form Image Replacement Breaking In ASP Classic

I skinned an LMS (Learning Management System) using CSS and Javascript. The forms were skinned with niceforms.js, the site works perfectly in FF, IE 7 and IE6 but in ASP the javascript doesn't replace the images with the skinned elements. All the javascript functions initialize but the images are not placed in. Code:

View Replies View Related

Display An Image From Access, Stored As Location Name Not Actual Image.

I have a client who has had a ASP site with an Access database for several years. It stores information for the used cars on his lot. I have stored text in the database that points to the location of the image for each record. Each record will have a thumb image that is supposed to display in a list of vehicles available then the user can select an item from this list and a new page displays with the information and the regular size image. So far everything has worked fine exept for the display of the images which are stored in a separate directory called veh-photos. All I get are image place holders. I am using Dreamweaver 2004 and and Access 2000 for the database.

Following is the code to list vehicles: ....

View Replies View Related

Open Image In 'Kodak Image Edit Control' With Web Browser

1.I want to show a image file of type '.tif' in the browser window; for that I'm writting as ASP code page.

2.This '.tif' type image can be shown better with 'Kodak Image Control'.

3.To have this 'Kodak Image Control' on my code page I just add it's ..ocx to tool box and then drag it from 'Toolbox' to the page.

4.Now after dropping this control to the code it's type is getting changed to 'object' instead of type 'ImgEdit'(and I think this is the
reason I don't get correct result).

5.On one button's 'Onclick' event I'm calling a javascript function with which I'm setting a 'Path'and'Display' property of a control.

6.And want to show a image at location -- '..MFTDRCMF919685173-62.tif' which get shown in new browser window but could not get shown in that particular control. That means the path is correct, then what is the problem?

For better understanding of problem I'm pasting a following code which I've tried up till now......
..................................................
<%@ Language=VBScript %>
<% OPTION EXPLICIT %>

<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

<SCRIPT LANGUAGE=javascript>
<!--
function showpic()
{
var path;
path = document.frmtif.path.value;
alert(path);
document.frmtif.ImgEdit1.Image =path;
document.frmtif.ImgEdit1.Display;
window.parent.self.open(path);
}

//-->
</script>

</HEAD>
<BODY bgColor=#ffe4e1>
<form name="frmtif">
The Image
<P>
<OBJECT id=ImgEdit1 style="WIDTH: 409px; HEIGHT: 218px" type="ImgEdit"
align=left
border=1 classid=clsid:6D940280-9F11-11CE-83FD-02608C3EC08A
name=imgtif></OBJECT>

<input type="hidden" name="path"
value="..MFTDRCMF919685173-62.tif">
<input type="button" name="show" value="Show" onclick="showpic();">
</P>

</form>
</BODY>
</HTML>

..................................................

View Replies View Related

Displaying Alternate Image When Image Source Not Found

I am creating a dynamic ASP VBScript page, which gets data from an Access database.

In the database, there is a field which holds a URL to an image. I can get the image to display fine, but where there is no file that matches the URL (i.e. a missing image) I want to display an alternative, default image (e.g. one that says "Awaiting Image"). The field is never blank, but the image file may not exist for all records in the database.

I think what I am trying to get to is the following:

If file exists (using URL from database to get location of image file) then
display image using the url from the database as the image source
else
display default image - hardcoded in program
endif

I have had a go and come up with the attached but I get an error with my if statement...

View Replies View Related

Image From Image Folder Into Byte Array?

I can convert an image that is retrieved from a FileUpload object into a byte array and insert it into the database..

When the user signs-up i wish tosimply insert into the Picture (DB Type = Image) field to an image i already have saved in my images folder?

Anyone know of a way to do this? Tutorials, articles or advise??!

View Replies View Related

Difference Between Environment Variables And Server Variables

can anyone tell me difference between environment variables and server variables.

View Replies View Related

Show Image From SQL Image Field?

Here is my code. I'm using 2 pages.

(Page 1) blob.asp

<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_blob_STRING
Recordset1.Source = "SELECT AboutPic FROM Elizabeth.GF_AboutUs"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Response.contentType = "image/jpg" 'Recordset1.Fields("AboutPic") <---Tried
both methods
size = Recordset1.Fields("AboutPic").ActualSize
blob = Recordset1.Fields("AboutPic").GetChunk(size)
Response.binarywrite(blob)
%>

(Page 2 Show the Image)

<%
Dim urlString
urlString = "?" & Request.QueryString
%>

<% Another rs to show other information as text from the same table %>

<body>
<img src="blob.asp<%=urlString%>" width="194" height="256">
</body>

View Replies View Related

Upload New Image Get Path Of Old Image

I'm working on a project where I'm suppose to upload a image to a server. The uploading works fine but when I want to change the image I uploaded to another image I can't get the filepath of the old image to show in my "filefiled"....is it possible to set a "value" where I can retrieve a filepath in a form if the input type is "file"?

View Replies View Related

<%=request.querystring("image")%> Image Won't Display

This worked fine for enlarging my images until i put it onto a secure server, anyone know how i can fix it ??? just comes up with the standard box with a red cross in it .. and the url when i click image properties says: http://url/images/<%=request.querystring( which is only part of the code)

View Replies View Related

Merge An Image Into Another Image

I'm looking for a simple way to merge an image into another image.What i have is a screenshot uploader, and i want to make it so that when they upload the SS, the script will automatically merge a small copyright type image onto the bottom right of the picture.

View Replies View Related

Referencing Variables Through Other Variables

I'm not sure how to best describe my problem, so a simple example should help explain things:

I have two arrays, called set1_data and set2_data

if I create a variable like so:

firstPart = "set1"

and then assign like this:

copyOfArray = firstPart & "_data"

how do I make copyOfArray reference the set1_array, as opposed to just a string "set1_array" which is what it's doing?

I've had a good rummage round ye olde Internet but couldn't find anything there must be a keyword or function to achieve this?!?

View Replies View Related

Javascript

I have a dll coded in vb that has a method X with the follwing signature

function X(a as string, optional b as string, optional c as string)

now i need to call this method from asp using javascript.

var dl = Server.CreateObject("dll");
dl.X(....);

I need to pass only 2 parameters 'a' and 'c'. Had it been vbscript I could have done dl.X(a,,c) but javascript doesn't accept that.

View Replies View Related

JavaScript Value

I'm having a customer submit an order. When they submit it, it posts to a
page that processes the order and inserts into our database, while
displaying a summary of their order. I have a javascript function that will
cause a "confirm" box to show up if an order seems like it might be a
duplicate. However, I can't seem to get the code to "wait" for the response
from that box, which I guess makes some sense. Am I stuck with having an
interim page or doing something with posts or is there an easy way to get
the record to not insert until the user responds to the confirm box?

View Replies View Related

Is There Any ASP Or JavaScript Out There That Will Take Out S P A C E S!!!

Im sure it exists but i am having some difficulty finding it. I need come code to take out any SPACES in a textbox when text is entered OR submitted. Example

i have a text box where people can enter there car registration.

To keep consistency thoughout my site, i want L736 VAF to be entered into the database as L736VAF.

so that when it is recalled via a search form, L736VAF wont be returned as "no record found" because some one has put a space init!

So i basically need code to eliminate any space!

View Replies View Related

JavaScript

I need to detect the users browser resolution (done with javascript)
var height= (screen.height)
var width= (screen.width)

Now I need to use these javascript variables to set the values of hidden html forms. How would I go about doing this.

<input name="width" type="hidden" value= Javascript Variable Here ?????>

View Replies View Related

ASP And Javascript

update some long commOn first page I display all the records from database (working well). Then first column has href which opens a popup (i am passing rownum from database to popup). I was hoping to run ASP code on load of the page so the comments which is already there for that row in the databse automatically comes in a textarea. And then you can edit and hit update. And this will update the database.
Also I was thinking of using session variables for the rownum. But bcos I have href which opens a popup, I am not sure how i can set the session variable.
I dont want to pass the "comments" itself to the next page bcos it can be really long comment and QueryString has some limitations.

View Replies View Related

Javascript

I am making a dynmanic form that goes to a question depended on the answer. Is there a way that I can make it remember what the person selected (radio button) in the question so that I don't have to write something like,

"<input type = 'radio' name='Question3' value='Yes' checked <% if Question3 = "Yes" then response.write "SELECTED" end if%>>Yes<BR>" + ????

View Replies View Related

Is It Possible Asp And Javascript Use Together

is it possible to use them together?i keep getting errors when i use them together

View Replies View Related

Asp With Javascript

I have a asp page that have an array for instance:

<%
a(0)=0
a(1)=1
a(2)=2
a(3)=3
%>

I would like to show each element of the array with alerts in javascript... Do you know what its the way to make something like this...

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved