Re: Why does html:submit work differently than html:link action=?
Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Why does html:submit work differently than html:link action=?
hi Robert, yes i've tried using javascript, but i must be doing something wrong. i've tried two approaches. 1) i was calling a javascript function that set the action for me and then submited the form. but the values inside my hidden fields weren't getting picked up. 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) andy On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller [EMAIL PROTECTED] wrote: Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - 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]
Re: Re: Why does html:submit work differently than html:link action=?
Andy, I don't have an answer but what I would try first is examining those values on the client. First do a view source on your generated HTML and make sure your values are there. Next in your Javascript after you've set any values but before you submit your form (which should be last anyway) use an alert command (Example: alert(my value = + form.field.value); ). Hope this helps. Robert [EMAIL PROTECTED] 7/28/2004 11:09:37 AM hi Robert, yes i've tried using javascript, but i must be doing something wrong. i've tried two approaches. 1) i was calling a javascript function that set the action for me and then submited the form. but the values inside my hidden fields weren't getting picked up. 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) andy On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller [EMAIL PROTECTED] wrote: Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - 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]
Re: Re: Why does html:submit work differently than html:link action=?
From: Andrew Close [EMAIL PROTECTED] 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) [Sorry, I didn't recognize this as the same issue from yesterday.] That doesn't make sense... either the element is on the form, or it's not. It shouldn't matter if the form gets submitted with a button or document.forms[0].submit(). Do you have a 'debug.jsp' that you can include at the bottom of all of your pages to dump the request/session attributes/parameters? And... that submit button of yours... its name isn't by any chance submit is it? If so, JavaScript might get confused between 'submit' the form element and 'submit()' the function. Try changing it to 'userAction' or something else, or just comment it out for now. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Why does html:submit work differently than html:link action=?
-Original Message- From: Andrew Close [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 9:10 AM To: Struts Users Mailing List Subject: Re: Re: Why does html:submit work differently than html:link action=? hi Robert, yes i've tried using javascript, but i must be doing something wrong. i've tried two approaches. 1) i was calling a javascript function that set the action for me and then submited the form. but the values inside my hidden fields weren't getting picked up. 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) That's not surprising, since that's what the submit button is supposed to do. You are trying to thing the non-standard and completely screwy way (which imntbho in general of doing ANYTHING in javascript). I would suggest that you are not calling, or setting up the form correctly in your javascript. Works with submit, doesn't work with javascript... it's a javascript issue, not a struts issue. I would suggest a javascript form might have more expertise then you might find here, but posting the javascript would be of help for those who do know something about javascript. andy On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller [EMAIL PROTECTED] wrote: Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-for m-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - 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]
Re: Re: Why does html:submit work differently than html:link action=?
Hi, Andrew: If you are going to show HTML try the pre tag and change the HTML tags with lt; and gt; instead of and . What you are doing, Andrew, is not clear to me. You have talked about using html:link instead of html:submit to submit a form. I have no idea why you would ever think these two would work the same. Ultimately, Struts tags must become standard HTML, of course. The link HTML tag is simply not meant to be a substitute for the input type='submit' HTML tag. You also talk about other things. I guess I missed the thread of this conversation early, but the latter part seems somewhat goofy to me. I don't mean it IS goofy, of course, but just that what you are saying sounds strange. Why use link for a submission of a form? I don't think link ever submits a form, does it? Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Why does html:submit work differently than html:link action=?
Andy - Based on your email it is hard to tell, but I think you are attempting to do a form.submit(); call in the link action to submit the form. Assuming this is the case, I have the following advice - if you MUST submit using javascript instead of a submit button, avoid the use of form.submit(); it seems to flake out a lot. Instead, setup a submit button using CSS to make it not display like so: input type=submit name=fakeSubmitButton style=display:none; / (if you don't know CSS, the style is what makes the button not show up on the page.) Then, wherever you have your form.submit(); call now, change it to be form.fakeSubmitButton.click(); This works far more reliably for me. Matt Bathje (sorry for the non-struts stuff!) - Original Message - From: Jim Barrows [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 11:16 AM Subject: RE: Re: Why does html:submit work differently than html:link action=? -Original Message- From: Andrew Close [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 9:10 AM To: Struts Users Mailing List Subject: Re: Re: Why does html:submit work differently than html:link action=? hi Robert, yes i've tried using javascript, but i must be doing something wrong. i've tried two approaches. 1) i was calling a javascript function that set the action for me and then submited the form. but the values inside my hidden fields weren't getting picked up. 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) That's not surprising, since that's what the submit button is supposed to do. You are trying to thing the non-standard and completely screwy way (which imntbho in general of doing ANYTHING in javascript). I would suggest that you are not calling, or setting up the form correctly in your javascript. Works with submit, doesn't work with javascript... it's a javascript issue, not a struts issue. I would suggest a javascript form might have more expertise then you might find here, but posting the javascript would be of help for those who do know something about javascript. andy On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller [EMAIL PROTECTED] wrote: Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-for m-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Why does html:submit work differently than html:link action=?
Andrew, could you restate what you are trying to do? Why are you using JavaScript? My guess is there is a safer and sounder way to solve whatever your problem is, if you merely are trying to submit a form with some issues which are unknown to me around that. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Re: Why does html:submit work differently than html:link action=?
Robert, :) i'm a step ahead of you. my values do show up in the client side html before submitting the form. and they show up in alert statements upon submission. that is what is so puzzling. i'm seeing the data, but when i set breakpoints in my actionform set methods, two of them aren't being called... andy On Wed, 28 Jul 2004 11:18:08 -0500, Robert Miller [EMAIL PROTECTED] wrote: Andy, I don't have an answer but what I would try first is examining those values on the client. First do a view source on your generated HTML and make sure your values are there. Next in your Javascript after you've set any values but before you submit your form (which should be last anyway) use an alert command (Example: alert(my value = + form.field.value); ). Hope this helps. Robert [EMAIL PROTECTED] 7/28/2004 11:09:37 AM hi Robert, yes i've tried using javascript, but i must be doing something wrong. i've tried two approaches. 1) i was calling a javascript function that set the action for me and then submited the form. but the values inside my hidden fields weren't getting picked up. 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) andy On Wed, 28 Jul 2004 10:58:44 -0500, Robert Miller [EMAIL PROTECTED] wrote: Andy, Sorry, I haven't been following your situation closely. Have you looked into using Javascript to have the link trigger form submission? An example of what I am talking about can be found here: http://www.javascript-coder.com/javascript-form/javascript-form-submit.phtml Robert [EMAIL PROTECTED] 7/28/2004 10:20:01 AM hi all, i'm still struggling with form submission. i would prefer to use links on the page to submit my form instead of a 'submit button'. but i'm unable to get the correct functionality to work. when submitting with the submit button all my hidden fields are slurped up and populated on the next page correctly. however, when using html:link i'm only able to get one of the values from my hidden fields slurped up. the others remain blank... using the debugger in my action form i only see one of the three set methods getting called even though all three hidden fields are inside the form and are populated. i am using the html:hidden field. ;) any thoughts? i'm sure there are others that use links on forms instead of buttons. what are you doing? thanks andy - 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]
Re: Re: Re: Why does html:submit work differently than html:link action=?
Hi Wendy, yes my submit button is named submit. but when i tested using it i wasn't using javascript. ;) only the links are using javascript to set one hidden field on the form. i hard coded that value with the submit button. in all cases the hardcoded value or the value set via javascript is picked up by my action form. using the submit button the other two hidden fields are picked up as well. however, when using the links the other two hidden fields are not picked up. i haven't seen anything in the request or session variables regarding those fields either. i was printing them out inside my action which would get the request before the jsp. so that should work the same. andy On Wed, 28 Jul 2004 09:18:16 -0700, Wendy Smoak [EMAIL PROTECTED] wrote: From: Andrew Close [EMAIL PROTECTED] 2) Wendy gave me a slightly different approach to try by calling the function and setting the values of the hidden fields and then submitting. however, two of the hidden fields are set upon arrival to the page by my action form. but they are not being picked up when i leave. all of this works flawlessly when using a submit button. :) [Sorry, I didn't recognize this as the same issue from yesterday.] That doesn't make sense... either the element is on the form, or it's not. It shouldn't matter if the form gets submitted with a button or document.forms[0].submit(). Do you have a 'debug.jsp' that you can include at the bottom of all of your pages to dump the request/session attributes/parameters? And... that submit button of yours... its name isn't by any chance submit is it? If so, JavaScript might get confused between 'submit' the form element and 'submit()' the function. Try changing it to 'userAction' or something else, or just comment it out for now. -- Wendy Smoak - 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]
Re: Re: Re: Why does html:submit work differently than html:link action=?
At 09:41 AM 7/28/2004, you wrote: Robert, :i'm seeing the data, but when i set breakpoints in my actionform set methods, two of them aren't being called... andy The question, Andy, whatever your problem is, that Robert is posing is whether form.field.value shows the data. Whether you are just seeing the data is not relevant. I am getting bugged trying to figure out what in the hay your problem could be to require this kind of a solution. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Why does html:submit work differently than html:link action=?
+1 on this.. Actually make that a +100..:) -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 12:44 PM To: Struts Users Mailing List Subject: Re: Re: Why does html:submit work differently than html:link action=? At 09:39 AM 7/28/2004, you wrote: Andy - Based on your email it is hard to tell, but I think you are attempting to do a form.submit(); call in the link action to submit the form. Andy, I would be willing to bet against pretty heavy odds that your attempted solution here, Andy, is not necessary or advisable. If you state what the problem is first, then I bet you will get lots of easy and cool solutions. Michael - 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]
Re: Re: Why does html:submit work differently than html:link action=?
Jim, heh, i would prefer not to use javascript, but i couldn't think of another way to submit the form with links. the form is a html:form and all of the html components inside the form are Struts html components. the link just has an onclick parameter in it that calls the javascript. the javascript is simply: document.form[0].myHiddenField.value = myValue; document.form[0}.submit; if found that just using the html:link forward= / non of the form values were being submitted. i also tried the html:link action= / and the same occurred. so i 'assumed' that html:link didn't actually submit the form but just forwarded to another page or called an action. that's why i deviated to the dark side. :) andy On Wed, 28 Jul 2004 09:16:13 -0700, Jim Barrows [EMAIL PROTECTED] wrote: That's not surprising, since that's what the submit button is supposed to do. You are trying to thing the non-standard and completely screwy way (which imntbho in general of doing ANYTHING in javascript). I would suggest that you are not calling, or setting up the form correctly in your javascript. Works with submit, doesn't work with javascript... it's a javascript issue, not a struts issue. I would suggest a javascript form might have more expertise then you might find here, but posting the javascript would be of help for those who do know something about javascript. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Why does html:submit work differently than html:link action=?
At 09:52 AM 7/28/2004, you wrote: heh, i would prefer not to use javascript, but i couldn't think of another way to submit the form with links. Why in Heaven's name would you want to submit a form with a link? Please step back one step further and tell us why you want to use a link to do what it is not made to do? I am sure you can use a submit to submit, if you will just tell us what you want to do, Andy. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Re: Why does html:submit work differently than html:link action=?
Hi Michael, i agree, what i'm attempting is kindof goofy. i'm trying to submit a form using a hyper-link instead of a submit button. i have three links on the page that perform similar but different actions. each link sets a value in a hidden field that should be picked up by the actionform upon submission and then passed to my action. you are right, hyperlinks do not submit forms like submit buttons. :) that's why i was attempting to submit the form using javascript. if i was 'allowed' to use separate submit buttons i would do that. or even radio buttons and a single submit button. but i was asked to use hyperlinks... i'll try to remember not to submit html without wrapping it in pre tags. sorry about that. :) and thanks for your reply. andy On Wed, 28 Jul 2004 09:35:19 -0700, Michael McGrady [EMAIL PROTECTED] wrote: Hi, Andrew: If you are going to show HTML try the pre tag and change the HTML tags with lt; and gt; instead of and . What you are doing, Andrew, is not clear to me. You have talked about using html:link instead of html:submit to submit a form. I have no idea why you would ever think these two would work the same. Ultimately, Struts tags must become standard HTML, of course. The link HTML tag is simply not meant to be a substitute for the input type='submit' HTML tag. You also talk about other things. I guess I missed the thread of this conversation early, but the latter part seems somewhat goofy to me. I don't mean it IS goofy, of course, but just that what you are saying sounds strange. Why use link for a submission of a form? I don't think link ever submits a form, does it? Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Why does html:submit work differently than html:link action=?
-Original Message- From: Andrew Close [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 9:52 AM To: Struts Users Mailing List Subject: Re: Re: Why does html:submit work differently than html:link action=? Jim, heh, i would prefer not to use javascript, but i couldn't think of another way to submit the form with links. the form is a html:form and all of the html components inside the form are Struts html components. the link just has an onclick parameter in it that calls the javascript. the javascript is simply: document.form[0].myHiddenField.value = myValue; document.form[0}.submit; if found that just using the html:link forward= / non of the form values were being submitted. i also tried the html:link action= / and the same occurred. so i 'assumed' that html:link didn't actually submit the form but just forwarded to another page or called an action. that's why i deviated to the dark side. :) Again.. based on the submit working and the javascript not (which is the only way the link thing will come close to working) it's a javacript issue. The submit button and form work together, the ActionForm is getting populated. The action is processing the action form. The problem is when you use javascript.. then you're probably not using javascript correctly. What that has to do with Struts I don't know. However... this is what I would try... I would take the rendered version of the page... copy it.. then using your browser submit that... and start tinkering with the javascript from there.. then once you get that working... copy your js to the jsp page. I really don't think that this is a problem between struts and js, since when the js runs, the struts tags are completely out of the picture. andy On Wed, 28 Jul 2004 09:16:13 -0700, Jim Barrows [EMAIL PROTECTED] wrote: That's not surprising, since that's what the submit button is supposed to do. You are trying to thing the non-standard and completely screwy way (which imntbho in general of doing ANYTHING in javascript). I would suggest that you are not calling, or setting up the form correctly in your javascript. Works with submit, doesn't work with javascript... it's a javascript issue, not a struts issue. I would suggest a javascript form might have more expertise then you might find here, but posting the javascript would be of help for those who do know something about javascript. - 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]
Re: Re: Re: Why does html:submit work differently than html:link action=?
At 09:58 AM 7/28/2004, you wrote: i agree, what i'm attempting is kindof goofy. Hi, Andy, You are stuck in a bad solution and all the discussion is about the goofy solution. However, if you would, once again, just tell us what the problem is, we can give you solutions, I would bet, that are not goofy. My guess is that you are trying to get dynamic data from a form and need multiple types of submissions. In order to solve this problem, you have got off the track and are using bizarre solution. If you state what the problem is, I am fairly certain, once again, that we can give you a standard solution. I would guess that you are unaware of the various things Struts can do for you in this regard with a standard submission. Please tell us what the bottom problem is. I am no longer interested in the bizarre solution but would like to know what problem that is supposed to solve. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Re: Re: Why does html:submit work differently than html:link action=?
At 10:16 AM 7/28/2004, you wrote: Sorry Michael, i wasn't ignoring you. you must've responded to each of my responses to the others. :) the original problem was that i have to add a product to the database. when the user clicks the initial add button they are taken to a page that has three links on it. Add Member Product Add NonMmeber Product Add Product via Search this intermediary page is a form that also contains three hidden fields. first is productType (member, nonmember or search) the other two fields contain values relating to the customer passed from the previous page when the customer clicked the add button. looking at the source for the current page with the three links on it reveals that the two hidden values from the previous page are set and the third, prodType, is blank. when the user clicks on one of the three links a small javascript function populates the third hidden field, prodType, before submitting the form. in my actionform and action i see the prodType but not the other two customer variables that were on the form. so i need to be give the customer the ability to add a new product to the database. there are three different types of products that can be added and the type needs to be determined up front so the customer can be directed to the appropriate form/page. hyperlinks were preferred to multiple submit buttons. and radio buttons with a single submit button were ruled out. Apparently you want to use a goofy solution. This whole problem is easily solved with multiple submit buttons with JavaScript. The hyperlink solution is just goofy, and if you insist on using that, good luck to you. I don't like to work on bad solutions. Why anyone would prefer a hyperlink to submit a form over a submit button is wholly beyond me. This is just poor coding. If you want a simple and good solution using multiple submit buttons, let us know. If you want to use a bizarre solution that has nothing to do with Struts, then I will leave you alone. I personally think you got off on the hyperlink solution because your previous inquiries (I used google to see where else you had gone with this problem) ended up in mistaken conclusions. I just hope this thread does not convince others that your solution is in any way required. To all you future readers: this solution is not required and is goofy. LOL ///;-) Seriously, Andy, good luck. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Re: Re: Why does html:submit work differently than html:link action=?
At 10:25 AM 7/28/2004, you wrote: Nope. It's not a struts issue at all... it's an HTML issue. My response was not really too tactful, Jim. Sorry! I am not a very tactful person. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Why does html:submit work differently than html:link action=?
At 10:12 AM 7/28/2004, you wrote: The text on each tab is a hyperlink, and I *have* to make the form submit when the user clicks to switch to another tab, or I lose whatever they've typed on the form. I do it with JavaScript: This is the problem, Wendy. Don't make the text on the tag a hyperlink and you don't have the problem. Make the text on the tag a submit. Is there any reason why that cannot be done? Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Re: Re: Why does html:submit work differently than html:link action=?
-Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 10:31 AM To: Struts Users Mailing List Subject: RE: Re: Re: Re: Why does html:submit work differently than html:link action=? At 10:25 AM 7/28/2004, you wrote: Nope. It's not a struts issue at all... it's an HTML issue. My response was not really too tactful, Jim. Sorry! I am not a very tactful person. We're geeks who expects tact? :) I understood what you said. And you're probalby right.. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
From: Andrew Close [EMAIL PROTECTED] so in the Struts world, is there a way to submit a form using a hyperlink without using javascript? In your case, YES, I think this can be done without JavaScript (although that's still my preferred solution). The reason is that it does not sound like the user gets to make any changes to the data on this page with the three links. In this case, you already know all three parameters that need to be 'submitted' to the server. Your three links would look like: http://www.example.com/strutsapp/someAction.do?param1=aparam2=bparam3=c param1 would vary for each of the three types of items, and param 2 3 come from the prior form. There has been some discussion lately about html:link only taking one parameter... I'd do it with JSTL, but if you have to use the original struts tags, you can bean:write the two params you need to pass through. So there isn't really a need for a form on this intermediate page, if you can get *all* of the parameters into the URL, and there are no other choices that the user gets to make. Personally I'd still do it with a form, three hidden fields, and JavaScript to set one of the form elements submit the form. Mostly so I could POST the form and keep the user from bookmarking something they shouldn't. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
At 10:37 AM 7/28/2004, you wrote: In your case, YES, I think this can be done without JavaScript (although that's still my preferred solution). The reason is that it does not sound like the user gets to make any changes to the data on this page with the three links. In this case, you already know all three parameters that need to be 'submitted' to the server. Wendy, You don't need JavaScript, Wendy, even if you make changes to the data on this page. That is irrelevant. I understand why you think otherwise, but it really is not relevant. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Re: Re: Why does html:submit work differently than html:link action=?
At 10:42 AM 7/28/2004, you wrote: if([ActionForm].getButton().getFirstChoice().pressed()) { // do whatever } else if ([ActionForm].getButton().getSecondChoice().pressed()) { // do whatever } else if([ActionForm].getButton().getSecondChoice().pressed()) { // do whatever } else { // throw exceptions galore } Oops, obviously, the third should read: else if([ActionForm].getButton().getThirdChoice().pressed()) { // do whatever } Michael
Re: Re: Why does html:submit work differently than html:link action=?
Wendy wrote: The text on each tab is a hyperlink, and I *have* to make the form submit when the user clicks to switch to another tab, or I lose whatever they've typed on the form. I do it with JavaScript: Michael wrote: This is the problem, Wendy. Don't make the text on the tag a hyperlink and you don't have the problem. Make the text on the tag a submit. Is there any reason why that cannot be done? I use Struts Menu. It pulls text from a config file and renders a tabbed menu at the top of my page with CSS. It doesn't render submit buttons, it renders hyperlinks. Cannot be done really isn't in my vocabulary-- anything it possible given enough time, money and motivation. ;) But in this case, the first issue that comes to mind is that the tabbed menus are in a separate Tile from the one that contains the html-el:form tags. For submit buttons to work, they'd have to be *within* the form tags, and AFAIK you can't split the form across multiple Tiles. While I appreciate that you've spent a lot of time working on your elegant solution, in this case the OP doesn't even appear to need JavaScript *or* a form, much less buttons on it. I'm going to bow out of this now-- you have your solution, I have mine, both of them work, and the OP can choose one of the many ideas that have been thrown out there and be on his way. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Why does html:submit work differently than html:link action=?
At 10:55 AM 7/28/2004, you wrote: I'm going to bow out of this now-- you have your solution, I have mine, both of them work, and the OP can choose one of the many ideas that have been thrown out there and be on his way. Okay dokay, and agreed. I always like discussing these things with you Wendy. Have a good day! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
wow, i didn't mean to start such a heated debate. :) but thanks to everyone for their suggestions. Wendy, i was actually doing something similar to your suggestion but i was appending the parameters to the action using javascript. i don't know why i didn't think of just putting them in the original link. thanks for that suggestion. Michael, i'm also going to check out your solution on the struts wiki. tthanks for pointing me to that. (i may email you off list with questions if you don't mind). thanks again everyone. andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
At 11:40 AM 7/28/2004, you wrote: wow, i didn't mean to start such a heated debate. :) but thanks to everyone for their suggestions. Hopefully more light than heat, Andy. I know I learned a lot. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
At 11:40 AM 7/28/2004, you wrote: (i may email you off list with questions if you don't mind). That's fine. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
At 02:36 PM 7/28/2004, you wrote: not to fuel the fire from the previous discussion, but this situation works fine if a href is used instead of html:link example: pre now use an anchor tag instead of the Struts anchor tag: Submit the form with a link Submit with a different value . . . hopefully that will help anyone else that was attempting to do goofy form submissions using links. ;) and As you can see here, Andy, we saw essentially nothing of what you sent, because you have to use escape characters for the HTML. However, html:link can provide exactly what you provide with a href so that cannot be the problem. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
At 02:44 PM 7/28/2004, you wrote: At 02:36 PM 7/28/2004, you wrote: not to fuel the fire from the previous discussion, but this situation works fine if a href is used instead of html:link example: pre now use an anchor tag instead of the Struts anchor tag: Submit the form with a link Submit with a different value . . . hopefully that will help anyone else that was attempting to do goofy form submissions using links. ;) and As you can see here, Andy, we saw essentially nothing of what you sent, because you have to use escape characters for the HTML. However, can provide exactly what you provide with lt;a hrefgt; with lt;html:linkgt; so that cannot be the problem. Michael - 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]
Re: Why does html:submit work differently than html:link action=?
ok, my bad. :) i tried html:link forward= / and html:link action= / but not html:link href= / next time i'll try 'all' the attributes before posting. ;) thanks Jim andy On Wed, 28 Jul 2004 14:50:26 -0700, Jim Barrows [EMAIL PROTECTED] wrote: -Original Message- From: Andrew Close [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 2:37 PM To: Struts Users Mailing List Subject: Re: Why does html:submit work differently than html:link action=? a href=# onclick=submitOne(); Submit the form with a link/a html:link href=# onclick=submitOne();Submit the form with a link/html:link does the same thing. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why does html:submit work differently than html:link action=?
-Original Message- From: Andrew Close [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 2:58 PM To: Struts Users Mailing List Subject: Re: Why does html:submit work differently than html:link action=? ok, my bad. :) i tried html:link forward= / and html:link action= / but not html:link href= / next time i'll try 'all' the attributes before posting. ;) No... just think about what you're doing and understand the technology. The infinite monkey approach sucks. The form is being submitted to wherever the form says, regardless of method used to submit. So, action and forward are entirely inappropriate to use for the link in this case. They have nothing to do with the what you want to do, which is submit the form using javascript. What was happening, in your case, was the onclick was firing the submit and then you were being sent to the link, and things got confused. Heck you don't even have to use a link for what you want.. you could just as easily use anything that has the onclick event. The link tag just gives you the visual cue that this is a link. thanks Jim andy On Wed, 28 Jul 2004 14:50:26 -0700, Jim Barrows [EMAIL PROTECTED] wrote: -Original Message- From: Andrew Close [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 2:37 PM To: Struts Users Mailing List Subject: Re: Why does html:submit work differently than html:link action=? a href=# onclick=submitOne(); Submit the form with a link/a html:link href=# onclick=submitOne();Submit the form with a link/html:link does the same thing. - 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]
Re: Why does html:submit work differently than html:link action=?
The form is being submitted to wherever the form says, regardless of method used to submit. So, action and forward are entirely inappropriate to use for the link in this case. They have nothing to do with the what you want to do, which is submit the form using javascript. What was happening, in your case, was the onclick was firing the submit and then you were being sent to the link, and things got confused. ok, that was probably part of my problem. i also think i was asking the wrong question (as well as blindly replying to ppls posts trying to help them understand what i was doing. :) the one thing i'm still fuzzy with is why would the actionform only populate with one of the three hidden field values? only the one that was being set via the javascript showed up on the next page. did the action servlet drop the page and only take the javascript value that was handed to it? of is there something else happening behind the scenes with action and forward that i just don't see yet? i'm just curious. i'd like to understand better how everything ties together (and works). thanks again. andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why does html:submit work differently than html:link action=?
-Original Message- From: Andrew Close [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 3:14 PM To: Struts Users Mailing List Subject: Re: Why does html:submit work differently than html:link action=? The form is being submitted to wherever the form says, regardless of method used to submit. So, action and forward are entirely inappropriate to use for the link in this case. They have nothing to do with the what you want to do, which is submit the form using javascript. What was happening, in your case, was the onclick was firing the submit and then you were being sent to the link, and things got confused. ok, that was probably part of my problem. i also think i was asking the wrong question (as well as blindly replying to ppls posts trying to help them understand what i was doing. :) the one thing i'm still fuzzy with is why would the actionform only populate with one of the three hidden field values? only the one that was being set via the javascript showed up on the next page. did the action servlet drop the page and only take the javascript value that was handed to it? of is there something else happening behind the scenes with action and forward that i just don't see yet? i'm just curious. i'd like to understand better how everything ties together (and works). With what you had... the struts stuff was either completely confused or out of the picture entirely.. essentially you had a browser submitting a form and going to a link at the same time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why does html:submit work differently than html:link action=?
From: Andrew Close [EMAIL PROTECTED] the one thing i'm still fuzzy with is why would the actionform only populate with one of the three hidden field values? That whole thing where you were adding parameters to the action attribute of the form, then submitting it with JavaScript called from an html:link tag? You should probably just try to forget that ever happened. ;) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why does html:submit work differently than html:link action=?
-Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 28, 2004 3:24 PM To: Struts Users Mailing List Subject: Re: Why does html:submit work differently than html:link action=? From: Andrew Close [EMAIL PROTECTED] the one thing i'm still fuzzy with is why would the actionform only populate with one of the three hidden field values? That whole thing where you were adding parameters to the action attribute of the form, then submitting it with JavaScript called from an html:link tag? You should probably just try to forget that ever happened. ;) Preferably... with a chainsaw large amounts of alcohol and a ferret. -- Wendy - 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]
Re: Why does html:submit work differently than html:link action=?
yeah, i was attempting to use a DispatchAction class instead of just single action classes for each event. so that parameter was the appropriate method in the DispatchAction class. i'm refactoring all that right now. using separate actions is easier for a noob to keep track of. ;) and simpler to deal with. On Wed, 28 Jul 2004 15:23:47 -0700, Wendy Smoak [EMAIL PROTECTED] wrote: From: Andrew Close [EMAIL PROTECTED] the one thing i'm still fuzzy with is why would the actionform only populate with one of the three hidden field values? That whole thing where you were adding parameters to the action attribute of the form, then submitting it with JavaScript called from an html:link tag? You should probably just try to forget that ever happened. ;) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]