You could use a GET request with the value for that field appended as a query parameter. These are treated the same as POSTed parameters when the form is populated. (Dont forget to rewrite the url to preserve session for cookie haters).
-Of course you will lose the values for all the other fields when you get back to the form from the server trip unless you do something tricky to avoid reloading the page - such as fire the request in a hidden iframe (of course if you to go to another page after this then thats probably a moot point) -----Original Message----- From: Manuel Lenz [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 June 2003 17:23 To: Struts Users Mailing List Subject: Antwort: RE: RE: Submitting value with Graphical Buttons Hi Dirk, you are right with your statement, but this is not exactly what I want to do. You are filling an input field in the html-page and submit this value. I´d like to fill directly an field in a specified FormBean on the server. But how do I address this field in the expected FormBean? I´dont like to use your solution, because the browser caches the input-values of the form. If an user takes the back-button to go to the last form, the field will be still filled in. This causes some following problems. Is there a possibility to save the value directly in the server-FormBean? Manuel |---------+----------------------------> | | | | | | | | | | |Dirk Markert | | |<[EMAIL PROTECTED]>| | |05.06.2003 11:10 | | |Bitte antworten an "Struts | | |Users Mailing List" | | | | |---------+----------------------------> >--------------------------------------------------------------------------- -------------------------------------------------| | | | An: Struts Users Mailing List <[EMAIL PROTECTED]> | | Kopie: | | Thema: RE: RE: Submitting value with Graphical Buttons | >--------------------------------------------------------------------------- -------------------------------------------------| Hello Manuel, using a page like: -------------------- </HEAD> <BODY BGCOLOR="#FDF5E6"> <H2 ALIGN="CENTER">Test</H2> <FORM Name="testForm" ACTION="http://localhost:8088/SomeProgram"> Field 1: <INPUT TYPE="TEXT" NAME="field1"><BR> <INPUT TYPE="SUBMIT"> </FORM> <a href="#" style="text-decoration:none;" onClick="javascript:document.testForm.field1.value='page.jsp'; document.testForm.submit()"> Test</a> </BODY> </HTML> --------------------------- my server received: ===================== Here is the request line and request headers sent by your browser: GET /SomeProgram?field1=page.jsp HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */* Accept-Language: de Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461) Host: localhost:8088 Connection: Keep-Alive ========================= I think thats exactly what you are expecting. I think your error is on the server side. Maybe your actionform? Thursday, June 5, 2003, 10:04:18 AM, you wrote: ML> Hi, ML> I have seen some examples like the one below, ML> but no one works with struts. I donŽt know how to address the form beans ML> field. And I habe to specify the paramŽs name IŽd like to save. ML> I tried this code, but it doesnŽt work: ML> <a href="#" style="text-decoration:none;" ML> onClick="javascript:document.testForm.fieldname.value ML> ='page.jsp'; ML> document.testForm.submit()"> ML> Where is the error? ML> How do I save a value in an FormBean by clicking a button? ML> Manuel ML> |---------+----------------------------> ML> | | | ML> | | | ML> | | | ML> | |"Rochak Sethi" | ML> | |<[EMAIL PROTECTED]> | ML> | |05.06.2003 08:56 | ML> | |Bitte antworten an "Struts | ML> | |Users Mailing List" | ML> | | | ML> |---------+----------------------------> ML> ML> > ---------------------------------------------------------------------------- ------------------------------------------------| ML> | ML> | An: "Struts Users Mailing List" <[EMAIL PROTECTED]> ML> | Kopie: ML> | Thema: RE: Submitting value with Graphical Buttons ML> ML> > ---------------------------------------------------------------------------- ------------------------------------------------| ML> hi , ML> a graphical button can be put inside a hyperlink tag and ML> onclick() function can be called ML> eg. ML> <a href="something" ><img src="something" onclick=fnSubmitForm ()>></a> ML> and in javascript u can make this function : ML> fnSubmitForm() ML> { ML> document.formname.submit(); ML> } ML> i am not too sure if i am tellng u something u dont know but i guess this ML> shud work. ML> tc ML> -----Original Message----- ML> From: Manuel Lenz [mailto:[EMAIL PROTECTED] ML> Sent: Thursday, June 05, 2003 12:20 PM ML> To: Struts Users Mailing List ML> Subject: Submitting value with Graphical Buttons ML> Hi to all, ML> I still have problems with submitting values by clicking graphical buttons. ML> By using javascript there must be an function named "on click ...." which ML> sets a value into a FormBean by pressing a graphical button. ML> To get a forwarding page a submit must be initialized too. A link to this ML> page might also work. ML> The value must be a constant one to identiy the page from which the user ML> has submitted. ML> Has anybody an idea how this works? ML> Greetings, ML> Manuel ML> --------------------------------------------------------------------- ML> To unsubscribe, e-mail: [EMAIL PROTECTED] ML> For additional commands, e-mail: [EMAIL PROTECTED] ML> --------------------------------------------------------------------- ML> To unsubscribe, e-mail: [EMAIL PROTECTED] ML> For additional commands, e-mail: [EMAIL PROTECTED] ML> --------------------------------------------------------------------- ML> To unsubscribe, e-mail: [EMAIL PROTECTED] ML> For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Dirk --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

