|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a form with a button in it
Code:
<button name='opcode' value='+'>Add</button> It submits my form in opera, in firefox but ie DOESNT submit the form when i click the button. The button just goes up-down but the form is not submitted. What's wrong? Maybe someone already encountered this prob. Thanks in advance |
|
#2
|
||||
|
||||
|
You need a type="submit" parameter. If that does not solve the problem, post the code for your whole form.
Edit: Ha. Beat you by a few seconds. Last edited by cwf : August 16th, 2007 at 11:38 AM. |
|
#3
|
||||
|
||||
|
Try
Code:
<button name='opcode' type='submit' value='+'>Add</button>
__________________
Fight Internet censorship! Code:
() ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments |
|
#4
|
|||
|
|||
|
Thanks guys. I've added type='submit' attribute so now it works. But IE sends what is between opening and closing tags i.e. 'Add' How could I fix it? I want the button to display arbitary text f.e. 'Add user' or the like but to send digits or single characters. I dont know how to do it. Any ideas?
|
|
#5
|
||||
|
||||
|
Unfortunately, MS did their own thing again and the <button value="..." parameter does not work - http://www.htmlcodetutorial.com/forms/_BUTTON_VALUE.html
|
|
#6
|
|||
|
|||
|
Yeah, unfortunately...I knew about it but I thought may be someone had invented a workaround.. Anyway thanks.
|
|
#7
|
||||
|
||||
|
I recommend using a different name="..." for the different function buttons and just check for the resultant variable with that name being set to determine which button was pressed.
Form code: Code:
<button name='opadd' type='submit'>Add</button> <button name='opsub' type='submit'>Subtract</button> PHP Code:
|
|
#8
|
|||
|
|||
|
Thank you. I'm gonna follow you advice. I think it's the most covinient way in this case. But there may be a leak in security in parsing code, 'caz it's possible to form a request containing both fields - opadd and opsub set so switch-break or if - elseif will be a more secure decision.
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > forms - A problem with button tag |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|