Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 10 Jan 2007, 20:23
PayBas PayBas is offline
 
Join Date: Jun 2006
Replacing multiple buttons with images in the same form?

Okay here's the deal, I'm trying to replace the "preview post" and "submit new thread" buttons in the "newthread" template with images, I need this for my skin.

So very basically this is what vBull looks like at default:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and I want it to look something like this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

However this does NOT work because Internet Explorer discards the "value" statement or something (it does work in FF). Basically you cannot have multiple image submit buttons cuz then it messes up .

I know this can be fixed by using javascript, but I cannot get it working.

Any help would be appreciated.
Reply With Quote
  #2  
Old 12 Jan 2007, 00:24
Floris Floris is offline
 
Join Date: Jan 2002
Because IE is like Deathstar, bad for all people.

http://groups.google.com/groups?th=e...1b1eda2&rnum=1

There is a technicality related to form submission if you use an image submit button. It is usually relevant only if you have several such buttons in one form. That's perfectly valid per se, but the usual instructions for including several submit buttons do not apply as such. When using image submit buttons, you need to use specifically different NAME attributes in order to be able to recognize in the form handler which button was clicked on.

The reason to this is the way in which image submit buttons contribute to form data set: the value of the VALUE attribute is ignored, and the coordinates of the clicked location are passed instead. For example, if you have <input type="image" src="submit.gif" name="foo" value="bar">, then the form data set contains the fields foo.x and foo.y, with numeric values that indicate the x and y coordinates of the clicked location.

http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html
__________________
My community; http://wetalknation.net
Reply With Quote
  #3  
Old 12 Jan 2007, 00:35
PayBas PayBas is offline
 
Join Date: Jun 2006
Yeah I read those sources even before I posted this topic . But this line puzzels me:

In addition to the usual limitations imposed by using client-side scripting, these techniques have some specific problems. In particular, the ONSUBMIT event handler for the form is not invoked; this however is not very serious, since you can put the code (e.g. for form data checking) into the ONSUBMIT attribute value before calling submit(). The JavaScript Form FAQ contains answers to questions related to these issues.
Does that mean that I cannot use the described javascript method in my case by default?


My javascript skills kinda suck so I ended up with stuff like this:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

which didnt get me anywhere.

You see the problem for me is that the "preview' button doesnt get registered correctly (or at all). Doesn't matter if I press "post" or "preview".... it gives the same result... the message gets posted.

Last edited by PayBas; 12 Jan 2007 at 00:40.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 22:15.

Layout Options | Width: Wide Color: