• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

how to set a form value programatically on PIE

 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been tasked to create a (smallish) JSP/servlet application to run targetted on iPaqs (thus in PDA).
So far it's going decently well, but I'm running into a problem with some pages that need to send html forms back to the server from different buttons (with different actions being executed based on the button pressed).
For example, the code (JSP) I have so far is as follows (irrelevant stuff removed for brevity):

The onclick (put in a _ to please the forum engine) events don't seem to set the form element value clicking the buttons, the expected actions aren't executed (one would set some data on the server and return to this page, the other set the data and forward to another page).
Any idea what I'm doing wrong here? It works fine in IE6 (the only access to a PDA to test on is one that someone else in the company has which I can have a look at a few times a day, still fighting to get one on my workstation).
 
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it OK to have 2 submit buttons for one form?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you might want to try to use regular buttons instead of submit buttons; and call the form to be submitted:
document.formName.submit();
Not sure if that will work or not.
Eric
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mapped the submits into the request, giving them all the same name attribute.
On the server I can now just check that attribute and get the value of the button clicked (thus identifying it).
Thinking of putting the button texts in a ResourceBundle to recover the complete separation of display code and logic code...
reply
    Bookmark Topic Watch Topic
  • New Topic