Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 16th, 2007, 11:03 AM
NetSurfer NetSurfer is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 82 NetSurfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 16 h 46 m
Reputation Power: 2
Unhappy forms - A problem with button tag

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

Reply With Quote
  #2  
Old August 16th, 2007, 11:36 AM
cwf's Avatar
cwf cwf is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 354 cwf User rank is Private First Class (20 - 50 Reputation Level)cwf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 3 Days 7 h 8 m 8 sec
Reputation Power: 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.

Reply With Quote
  #3  
Old August 16th, 2007, 11:36 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,327 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 26229 Folding Title: Starter FolderFolding Points: 26229 Folding Title: Starter Folder
Time spent in forums: 6 Days 12 h 42 m 12 sec
Reputation Power: 4
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

Reply With Quote
  #4  
Old August 16th, 2007, 01:28 PM
NetSurfer NetSurfer is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 82 NetSurfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 16 h 46 m
Reputation Power: 2
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?

Reply With Quote
  #5  
Old August 16th, 2007, 03:48 PM
cwf's Avatar
cwf cwf is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 354 cwf User rank is Private First Class (20 - 50 Reputation Level)cwf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 3 Days 7 h 8 m 8 sec
Reputation Power: 2
Unfortunately, MS did their own thing again and the <button value="..." parameter does not work - http://www.htmlcodetutorial.com/forms/_BUTTON_VALUE.html

Reply With Quote
  #6  
Old August 17th, 2007, 09:15 AM
NetSurfer NetSurfer is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 82 NetSurfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 16 h 46 m
Reputation Power: 2
Yeah, unfortunately...I knew about it but I thought may be someone had invented a workaround.. Anyway thanks.

Reply With Quote
  #7  
Old August 17th, 2007, 09:52 AM
cwf's Avatar
cwf cwf is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 354 cwf User rank is Private First Class (20 - 50 Reputation Level)cwf User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 3 Days 7 h 8 m 8 sec
Reputation Power: 2
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>
Processing code:
PHP Code:
if(isset($_POST['opadd'])){ // addition code ... }
if(isset($_POST['opsub'])){ // subtraction code ... } 

Reply With Quote
  #8  
Old August 17th, 2007, 01:01 PM
NetSurfer NetSurfer is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Jul 2007
Posts: 82 NetSurfer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 16 h 46 m
Reputation Power: 2
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.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > forms - A problem with button tag


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT