Passing a conditional form variable (Was: 'Trying to use images asform submit buttons')

O

Orest Kinasevych

Okay, I made sense of the earlier suggestions and realized I was on the
right track -- I appreciate the feedback which got me to this point.

The suggestions posted here indeed worked and eliminated the JavaScript
errors I was seeing. The fact that the target URL didn't execute was
because certain variables weren't being passed to it.

What I need to do is to pass a conditional variable to the target URL,
when the form is submitted, depending on which graphic button is pressed.

So, the form already sends several variables when the form is submitted
(at the onclick event). I've confirmed this by capturing the HTTP POST
variables and displaying them when the page executes.

Now, depending on which graphic button is selected, I would like to pass
another variable.

For example, when the Create button is pressed, I would like to pass
create=true (or something signifying that 'create' is set) to the target
URL.

How would I accomplish this? Any suggestions?

- Orest
 
S

Sean Jorden

Now, depending on which graphic button is selected, I would like to pass
another variable.

For example, when the Create button is pressed, I would like to pass
create=true (or something signifying that 'create' is set) to the target
URL.

You could give your image tags names, like this:

<input type="image" src="create.gif" name="create" />
<input type="image" src="delete.gif" name="delete" />

on the other side in the form collection, you will see the x and y
coordinates of the image they pressed, such as

create.x = 34

delete.x = 46

so you can test for the length > 0 of create.x or delete.x


hope I have understood your problem correctly.


Sean Jorden
Norada Corp.
 

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

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,689
Members
48,796
Latest member
Greg L.

Latest Threads

Top