Vincent Micchia

Greenhorn
+ Follow
since Nov 09, 2011
Vincent likes ...
Netbeans IDE PHP Windows
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Vincent Micchia

Here's what I can get or at least what I think is right.

12 years ago
No you are correct. What I want to do is then feed it into a secondary hidden form of a different layout. So basically I want to take these values and put them into seperate text boxes. I know it sounds odd but it seems the best solution to my current problem.

So it would be something like: <input type="hidden" name="prod1" value="hamburger"><input type="hidden" name="price1" value="3.00">...

So maybe the whole array idea isn't even the way to go. I guess my real problem is I can print the data out into one long string but I'm not entirely sure how to go about seperating it out into the seperate pieces.
12 years ago
Welcome Budi. Thank you for helping us here.
12 years ago
Hey there working on learning jsp. I have this code that takes CSVs from a text area and right now seperates then by commas and \n then prints it out. Where I'm stuck is that I need to either put all the values into an array and be able to check every other value or put evey other value into a seperate array (not sure which would make more sense). So i guess the big thing is I can seperate the value and print them but I'm just not understanding how to put them into an array. Any help or pointing in the right direction is much appreciated.

Here's the code I have now:
12 years ago
Aslo as a side note. The code that this form data gets submitted to does all the validation and error checking already. For me it's really just getting the data in the correct format (form field post data.)
Well I wrote it in php because I'm considerably more familiar with that but it would seem that I'm not going to be able to do it that way. Any help turning this into jsp would be much appreciated.



Edit: removed code for displaying the array don't need that was just for testing.

Bear Bibeault wrote:Seems to me that a better solution would be to refactor the original servlet to use a lower-level API that both forms of input could share. How are you planning on validating the CSV?



Well I can't validate the first value in each line other than it being there. The second value had to be a number snd I was hoping I could make sure there were no more than 2 values before the \n if that is possible.

Edit: was going to split the values into and array first and then check every other value for the needed validation.
Well it's a precursor to allowing excel data to be imported. But this is faster and works for the time being. Users have been asking for something like this so yeah here I am.

Bear Bibeault wrote:I'm not exactly sure what you are trying to accomplish by your description, but be aware that hacking around is likely to create more confusion that just doing things in a straight-forward manner.

That said, the only other way to generate a POST from a browser other than a form is via Ajax.



I understand. What it basically is is that I have a existing ability on my site to do this, but want a user to be able to submit the information in a different way.

Currenty a user can enter a item and a quantity(only 10 of these at the moment each with their own text box), then these get sent to a page that displays the result. What I want to do is let the user enter the information in a text area via comma seperated values (so they can use as many as they want at once) but still come to the same results page. So for that to work I need to parse the data from the text area and then send it with the same POST values as the individual text boxes would have had.

New to this so that seems like the simplest way but perhaps not so much.
Basically I'm wondering if there is a way to send POST data without actually using a form. I ask this because what I want to do is take data from a text area ans seperate it then send the values to a page that currently takes data from seperate form fields.

I only want to do this because I already have the page that gets the results for the request it just currently take data differently. I'm new to this so if I could just use the existing page and feed data into it rather than make a new one it would be great.