HTML WebForm Question

AMDZen

Lifer
Apr 15, 2004
12,589
0
76
OK so here are a couple pictures of a webform some people I know created (I guess in Frontpage) the first one has a box that says "paste parts list here" the second has it broken into columns the way they wanted to do it which has various fields laid out left to right.

1
2

The second picture represents, from a webpage standpoint, what we wanted to accomplish. However, when printing the output form data, the correlation, left to right is lost and the printout ends up like this.

PartsList: asdjfl;asdj;lasdjf
a;lsdjf;lasdjf;lasd
a;sldkjf;sladjf
a;sldjfa;sldjf
Quantity: 1
2
3
4
SerialNumber: 369852
147852
258741
963258

Is there a Tag thats relatively easy to fix this?
 

Vogel515

Senior member
Jun 17, 2005
249
0
0
Well, I'm not sure I follow you 100% but the values of those three fields have no 'correlation'.

I don't even know why you'd set up your form that way, if someone enters a part should the serial# be automatically filled? or are you trying to use this to fill a database/table?

You will either a) have to create individual groups of 3 input boxes to take the necessary information, once its submitted you will then have to concatenate them and then parse it to get it the way you want. b) use a database/mysql and set it up to export a table for printing purposes...
 

AMDZen

Lifer
Apr 15, 2004
12,589
0
76
Originally posted by: Vogel515
Well, I'm not sure I follow you 100% but the values of those three fields have no 'correlation'.

I don't even know why you'd set up your form that way, if someone enters a part should the serial# be automatically filled? or are you trying to use this to fill a database/table?

You will either a) have to create individual groups of 3 input boxes to take the necessary information, once its submitted you will then have to concatenate them and then parse it to get it the way you want. b) use a database/mysql and set it up to export a table for printing purposes...

It won't be tied to a database, the user entering the information will simply be inputting all of the data. The second picture has it all as seperate fields but I guess we will need to concatenate them. We would basically want it to output the data like it would look on a spreadsheet.

Part # 123 QTY 1 Serial # 123

Originally posted by: Crusty
What do you mean by printing?

By printing I just mean on a printer. I assume the output data would need to be output to a text file in the same manner. The way the form is currently set up, the information is relayed top to bottom and loses the left to right correlation that we would want per the example above. 3 fields that output next to each other and will thusly print out that way.

I think Vogel515 knows what I need by saying that the data would need to be concatenated however I don't know how that could be done automatically for the web form. We aren't doing anything complicated like tieing it to a database so its just what you see on the picture.

Its really just a bunch of people that don't know what their doing coming to me when I don't know how to do it either. The reason they asked me is to sidestep IT, I'm quite good at figuring things out via google so even though I don't know, I've shown in the past that I can get things to work. I'm thinking they'll just need to go to IT however I thought I'd come here and ask some experts first. If its a relatively easy Tag I just need to add to the source of those columns then I can obviously do it, if not I'll send it along.
 

AMDZen

Lifer
Apr 15, 2004
12,589
0
76
OK I think I understand that all I need to do is do seperate data fields for Part #, QTY and Serial # and then just do 3 boxes, then 3 more boxes, then 3 more boxes. That makes sense

So if I do this, is there a function either in Frontpage or a simple tag that will expand incase they need more fields? I could add like 3 but I wouldn't want the webpage to have more then say 5 sets of the 3 boxes. So if they need to add more then 5 part numbers, I'll need to figure out how to do that.

Sorry if I'm not explaining this all very well, talking through it is helping me figure it out though.
 

Vogel515

Senior member
Jun 17, 2005
249
0
0
EDIT: Scratch what I said... you got it...



There is no simple way to get it to just expand if they want more fields. You'd need to add some PHP / javascript or something else...
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
Ah, I think I understand now. I thought this was actually a website, instead it's just an HTML form used to format data for printing?

You would have to use javascript in order to provide more input fields. You could just have a button that the user clicks that adds a new set of input fields. I'm sure someone else can help you with the actual code.
 

AMDZen

Lifer
Apr 15, 2004
12,589
0
76
Originally posted by: Crusty
You would have to use javascript in order to provide more input fields. You could just have a button that the user clicks that adds a new set of input fields. I'm sure someone else can help you with the actual code.

Thats what I thought. If anyone can help with this let me know
 

PhatoseAlpha

Platinum Member
Apr 10, 2005
2,131
21
81
Hmm. Well, the first the you'll need is a div which will be the holder area for the forms. I'd probably then want 'item' to also be it's own div, with the input elements formatted in there. Are you going to need deleting abilities too?


The you make a button with an onclick event that calls a function like this:

function addNewButton()
{
var GroupPanel = document.getElementById('IDoftheholderDivGoesHere');
var NewButton = document.createElement('div');
NewButton.innerHTML = "theHTMLofthebuttongroup - anything between the div tags that make up a button - goes here";
GroupPanel.appendChild(NewButton);
}


}


Edit: Would it be fair to assume you're using CSS media selections to control printing of these things? And do you have to worry about multiple browsers, or is everyone IE or whatever?
 

AMDZen

Lifer
Apr 15, 2004
12,589
0
76
Originally posted by: PhatoseAlpha
Edit: Would it be fair to assume you're using CSS media selections to control printing of these things? And do you have to worry about multiple browsers, or is everyone IE or whatever?

Honestly I have no idea, the webform was made entirely in Frontpage if that tells you anything.
 

911paramedic

Diamond Member
Jan 7, 2002
9,448
1
76
Since they are in fields, it will print as a field...all of it. Unless you want to do some php to format the output and go through loops it will come out that way, or you can use individual fields which would be tedious. (Except for the javascript route mentioned above.)