<BUTTON> tag submits 'innerText' content instead of 'value'

In Internet Explorer 6.0

<form action="" method="get">
<input type="text" value="ddd" name="sampletext">
<button name="samplebutton" VALUE="correct" type="submit"><IMG SRC="openwindow16x16.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT="" hspace=4 align="middle">Submit</button>
</form>

How can I submit 'correct' value using "BUTTON" tag?
maximkrAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mosphatCommented:
<form action="" method="get">
<input type="text" value="ddd" name="sampletext">
<button name="samplebutton" onclick="this.form.samplebutton.value='correct';this.form.submit();"
><IMG SRC="openwindow16x16.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT="" hspace=4 align="middle">Submit</button>
</form>

But you'll see the button change shortly before submitting.

If that's not what you want, why not use a hidden field to transfer the value, like this:

<form action="" method="get">
<input type="text" value="ddd" name="sampletext">
<input type="hidden" name="samplebutton" value="correct">
<button name="dummy" onclick="this.form.samplebutton.value='correct';this.form.submit();"
><IMG SRC="openwindow16x16.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT="" hspace=4 align="middle">Submit</button>
</form>
0
mosphatCommented:
In that last option you'd leave out 'this.form.samplebutton.value='correct';'. My mistake.
0
maximkrAuthor Commented:
> onclick="this.form.samplebutton.value='correct';this.form.submit();"

We need a solution without javascript. Actually, the 'value' of button is not important for us. Can some 'innerHTML' values cause any vulnerabilities?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

mosphatCommented:
You mean whether having &samplebutton=%3CIMG+height%3D16+alt%3D%22%22+hspace%3D4+src%3D%22openwindow16x16.gif%22+width%3D16+align%3Dmiddle+border%3D0%3ESubmit
in your URL can be harmfull? The answer is no, not as long as you don't actually use the samplebutton value somewhere.
It's just not a very pretty sight, I guess.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mosphatCommented:
If you leave out the name="samplebutton" part, it will work too, without sending a value along (since it isn't important anyway):

<form action="" method="get">
<input type="text" value="ddd" name="sampletext">
<button type="submit"><IMG SRC="openwindow16x16.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT="" hspace=4 align="middle">Submit</button>
</form>
0
maximkrAuthor Commented:
>If you leave out the name="samplebutton" part, it will work too, without sending a value along

we use 'name' parameter to detect, which button was pressed.
Is seems, 'button' problem is IE-specific. In Mozilla browser all values submits fine.
0
mosphatCommented:
I don't think that IE bug can be solved without resorting to javascript.
Unless you take the %3CIMG+height%3D16+alt%3D%22%22+hspace%3D4+src%3D%22openwindow16x16.gif%22+width%3D16+align%3Dmiddle+border%3D0%3ESubmit
into account when determining which button was pressed on the server side of course.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Browsers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.