...

View Full Version : order form



tweetie37
09-25-2003, 08:00 PM
Hi everyone:
I am new to JS so I'll appreciate any help I can get. I want an order form to do this:
First customers enter their name & address, etc. Then, when they click on a flyer they want to buy, their info automatically will show up on the flyer (to show them as a sample of how their flyer whould look like).
Also, I want to do a type of shopping cart that when they enter the # of flyers, the total would show the actual total (ex: 5000 flyers X $.37 each = $1850) which is $1850 and so on down the line.
I'll be grateful for any help,
Thanks

lavalamp
09-25-2003, 09:14 PM
Well the shopping cart thing I can help you with straight away because I have one already made, even though client side JavaScript would not be the best tool for the job.

The flyer, you could just have the text displayed on the page with the background for the text as the image for the flyer. JavaScript cannot create files other than cookies so if you want the preview to be all an image rather than text on top of an image I would suggest learning PHP.

In any case, here's the shopping cart for starters, although for some reaon it doesn't work for Opera so I'll work on a fix for that:

tweetie37
09-26-2003, 03:23 PM
Thanks for the shopping cart!!!!

tweetie37
09-26-2003, 03:27 PM
How about if I want to do this:
I have 3 or 4 flyers (or brochures) lined up and customers will click on the one they want to order and VOILA the flyer's number will show up on the line indicated! Is this possible in JS?
Or should I just put radio buttons besides each flyer and they can just select which flyer they want? Is that just a regular radio button code or is it more complicated? If it is, can someone please help me with the code................
Thanks a bunch!

lavalamp
09-26-2003, 03:50 PM
I'm going to work on an Opera friendly version, and possibly add extra fetures like including how many of each item they have selected in the text boxes when they go back to the first page.

Happy to help. :)

lavalamp
09-26-2003, 08:07 PM
Hows this, it stores the values in an array and displays them in a textarea for the customer to see:

tweetie37
09-30-2003, 03:26 PM
Thanks lavalamp:
I'll appreciate all your help. Your flyer thing might work. I am going to try it with a flyer and see. I'll let you know......

tweetie37
09-30-2003, 04:37 PM
Hi lavalamp:
If you didn't get my email, here what I need help me(more help!!!) Is it possible to total the flyers right there. What I mean is for example: They buy 500 flyer for $1.00 each. Can the form calculate the total right there? Is it possible? I'll appreciate any help you can give me....
Thanks

tweetie37
09-30-2003, 04:44 PM
Lavalamp:
I forgot to tell you that the customers order a large amount. Can we modify the code for a large amount instead of one at a time? They buy 500 or more at one time.
I hope I am not confusing you. This is what I originally had in mind. If it can't be done, just something they can click on and they can order 500 of flyer (say #1). Is this possible?
In other words, they can select a flyer and buy 500 of it and get a total price in the page.
Thanks

lavalamp
09-30-2003, 09:39 PM
I think I remember getting an e-mail that mentioned something about tweetie, but if I don't recognize the name I tend to just delete it, sorry. Ask me in a private message next time and then I can't ignore it.

Anyway, I went away and modified it beyond all recognition. It's become at least 100 times more complicated so if you get lost I don't blame you, I get lost in it and I wrote it.
I've used some CSS and div tags to arrange the content on the page in a suitable way, although you'll probably be more interested in the JavaScript section. If you need help wading through it, ask me and I'll be happy to figure it out for myself and then explain.

tweetie37
09-30-2003, 10:00 PM
Thanks lavalamp. I am going to read through your code and see if I can understand it and let you know.

lavalamp
09-30-2003, 10:05 PM
Just before you go off and read through that one, read trough this one instead. I forgot to include a unit of currency in that one, but in this version I have included it. To find out where, just search the source for a sign, (there's 2 of them).

tweetie37
09-30-2003, 10:45 PM
Thanks for the code. I'll really appreciate this. Can I ask something else? How do I add postage to this. If they want to order 1st class postage say @ $.10 and Tax. After that , how do I total everything and give the customer a final Total?
Thanks again

lavalamp
09-30-2003, 11:03 PM
It just keeps getting better:

Edit: You don't have to PM me if I'm online, I get an e-mail notification every time that a post I'm subscribed to gets a reply. Even when I'm offline I can still view the e-mails from when people replied. It's just that if the thread is a couple of days or weeks old that I need a reminder about it.

By the way, that postage seems a bit low. Did you mean 0.10 per 100 flyers or something?

tweetie37
09-30-2003, 11:26 PM
Lavalamp:
How do I give them the option of adding the postage (1st class or standard) or even tax ? ( like a check box or something). Since I have you here, I am going on the asking rampage!!!!!!!!!!!
I am still adding other stuff to this form. Such as some gifts that they can add to their order. I want to put some image such as an umbrella (as a gift) and they can choose their gift by either clicking on the image or just check it. Do I add the sumbit button at the very end after </form>? Please do not KILL me with all these questions. I am just new to JS.
Thanks again!

lavalamp
09-30-2003, 11:36 PM
Well I would probably use radio buttons (only 1 can be selected at a time) for the postage, and again for the free gifts so that they can select one from a list (I must ask, do you want the option for no gift?), although if there are too many of them I would use a drop-down menu.

There were only the 2 questions that I could pick out there, so the urge to kill you isn't that strong.
There was a possible third question but I'm not sure about it, it seems that you want to give them the option to pay tax or not. Is this correct or have I got hold of the wrong end of the stick?

Edit: I realise that my code isn't very user friendly, so I'll try to create as many variables as possible and put them at the top of the script, so that it's inner workings can be easily changed at the push of a button. I'll try and tidy the code up a little bit aswell, but I can't promise anything.

lavalamp
10-01-2003, 12:06 AM
OK, so I lied about the tidying everything up, sue me. Maybe I'll do it some other time but it's far too late to do now.

tweetie37
10-01-2003, 04:05 PM
Thanks for staying up late to do this.!!! Yah, tax and postage both will be optional. So, how can I modify your last code to do this optional thing? The thing is I am a little confused about your code to know where to insert the new code. That is why I keep asking you where to put the new items. I hope this is OKAY.......

lavalamp
10-01-2003, 09:51 PM
Well here's Ordering Flyers 5, and I'm working on Ordering Flyers 5 (Tidy).

tweetie37
10-01-2003, 10:47 PM
Lavalamp:
You are the greatest! It is awsome. Now, I know you are ready to kill me, but where do I put my submit & clear button. I also want them to print the page & fax it to me. I want the information on that page come to my email address. I have this code but it is not working (my site is not up on the host yet. I have it on my hard drive right now) Is that why it is not working or am I missing a code somewhere?
<script language="javascript">
if (window.print){
document.write('<form>Click here to'
+ '<input type=button name=print value="PRINT"'
+ 'onClick="javascript:window.print()"> this page & fax it to us &#64; 813.655.6555!</form>');
}
</script>
<form name="onlineform" onsubmit="return CheckVals();" action="mailto:morgan@roverwireless.com" method="POST">
<input type="submit" name="Submit" value="Submit">

<input type=reset value="Clear Form">///DOES NOT CLEAR THE FORM!!!!
</form>
I'll be greatful again.....

lavalamp
10-01-2003, 11:06 PM
A reset button only resets the form that it is in, same thing for a submit button, that's whay you should put every thing inside one big form.
Since a form encompasses almost the entire page I wouldn't have thought this would be a problem, but it seems that you've gone out of your way to make it difficult.

lavalamp
10-02-2003, 12:44 AM
OK, I went away and tidied it up as much as I could. I also included the reset, submit and print buttons so this has now become Ordering Flyers 6 (Tidy).

tweetie37
10-02-2003, 03:50 PM
Well, what can I say? You are the best. Thank you so much for spending this much time on this. I am actually beginning to understand your code! I did a test and submited the form and when I opened my email, the email from my self was there and I got this:
"OE removed access to the following unsafe attachment in your mail:POSTDATA.ATT"
There is the attachment of POSTDATA.ATT but it is disabled.
I guess it is because of the site being on my hard drive and not up yet and emailing to my own computer gave me error??? What do you think?
Thanks

tweetie37
10-02-2003, 03:57 PM
Oh, I forgot this::::This is what I have for contact information. Where should I insert it? Thanks

<table>
<TR height="136">
<TD height="136" align="right" bgcolor="#FFFFFf" valign="top" width="52">
</TD>
<TD height="136" colspan="2" bgcolor="#FFFFFf" align="left" valign="top">
<p><font color="black" face="arial" size="3"><b>Contact
Information </b></font><br>
<FONT color="black" face="arial" size="1"><br>
DEALERSHIP NAME *required<BR>
</FONT><FONT size="1">
<INPUT type="text" name="DealerName" size="26">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1">
DEALERSHIP CONTACT &#38; TITLE *required<BR>
</FONT><FONT size="1">
<INPUT type="text" name="ContactName" size="26">
<BR>
<BR>
</font>
<FONT color="black" face="arial" size="1">MAILING ADDRESS *required<BR>
</FONT><FONT size="1">
<INPUT type="text" name="MailingAddress1" size="26">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1"> MAILING ADDRESS<BR>
</FONT><FONT size="1">
<INPUT type="text" name="MailingAddress2" size="26">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1">CITY *required<BR>
</FONT><FONT size="1">
<INPUT type="text" name="City" size="26">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1">STATE *required<br>
</FONT><FONT size="1">
<select name="State" size="1">
<option value="alabama">AL</option>
<option value="alaska">AK</option>
<option value="arizona">AZ</option>
<option value="arkansas">AR</option>
<option value="california">CA</option>
<option value="colorado">CO</option>
<option value="connecticut">CT</option>
<option value="delaware">DE</option>
<option value="florida">FL</option>
<option value="georgia">GA</option>
<option value="hawaii">HI</option>
<option value="idaho">ID</option>
<option value="illinois">IL</option>
<option value="indiana">IN</option>
<option value="iowa">IA</option>
<option value="kansas">KS</option>
<option value="kentucky">KY</option>
<option value="louisana">LA</option>
<option value="maine">ME</option>
<option value="maryland">MD</option>
<option value="massachusetts">MA</option>
<option value="michigan">MI</option>
<option value="minnesota">MN</option>
<option value="mississippi">MS</option>
<option value="missouri">MO</option>
<option value="montana">MT</option>
<option value="nebraska">NE</option>
<option value="nevada">NV</option>
<option value="newhampshire">NH</option>
<option value="newjersey">NJ</option>
<option value="newmexico">NM</option>
<option value="newyork">NY</option>
<option value="northcarolina">NC</option>
<option value="northdakota">ND</option>
<option value="ohio">OH</option>
<option value="oklahoma">OK</option>
<option value="oregon">OR</option>
<option value="pennsylvania">PA</option>
<option value="rhodeisland">RI</option>
<option value="southcarolina">SC</option>
<option value="southdakota">SD</option>
<option value="tennessee">TN</option>
<option value="texas">TX</option>
<option value="utah">UT</option>
<option value="vermont">VT</option>
<option value="virginia">VA</option>
<option value="washington">WA</option>
<option value="westvirginia">WV</option>
<option value="wisconsin">WI</option>
<option value="wyoming">WY</option>
</select>
<FONT size="1">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1">ZIP
CODE *required<BR>
</FONT><FONT size="1">
<INPUT type="text" name="Zip" size="26">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1">DAY
PHONE *required<BR>
</FONT><FONT size="1">
<INPUT type="text" name="Phone" size="26">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1">FAX<BR>
</FONT><FONT size="1">
<INPUT type="text" name="Fax" size="26">
<BR>
<BR>
</FONT>
<FONT color="black" face="arial" size="1">EMAIL *required*<BR>
</FONT><FONT size="1">
<INPUT type="text" name="Email" size="26">
</FONT></font></p>
</TD>
<TD height="136" colspan="2" bgcolor="#FFFFFfF" valign="top">
<P align="left"><FONT size="1"><FONT size="1"><BR>
<BR>
<br>
</FONT><FONT color="black" face="arial" size="1">ADDRESS ON FLYER IF DIFFERENT FROM MAILING<BR>
<TEXTAREA name="Addressflyer" cols="34" rows="4"></TEXTAREA></font>
<br>
<br>
</div></td>
</tr>
</table>

tweetie37
10-02-2003, 10:18 PM
I know I am bugging you big time, but when you have time let me know: my boss wants no mention of the tax in the form!!! I tried to take anything tax related out but it messed up the whole form..... (obviously I took out the wrong code or something). You don't need to redo anything, just tell me what code to take out?
I'll be grateful forever!!!!

lavalamp
10-02-2003, 11:17 PM
I have high-lighted the bits to take out by encompassing the code to be removed like this:

// ************************************************** //
var tax="yes"; // The default Tax to pay, I'm sure that you get the drill by now.
// ************************************************** //

I'll have to do the other thing you asked some other time because I'm shattered from playing lots of Badminton.

Be sure to look out for this comment:
// You will have to manually input the %age for tax in here by replacing taxedflyers[tax] with a number (eg. 10 for 10%).

You should be able to find it easily enough.

By the way, not to be rude or anything, but if you're getting paid to do this sort of stuff, why is it that you're in a help forum? Or is this just something that you offered to do, that's not part of your job description?
Don't feel inclined to answer this, it's just that I'm curious and too nosey for my own good.

tweetie37
10-03-2003, 02:59 PM
That's okay. It is something I offered to do and I am sorry that I am taking so much of your time. It's just I was not very familiar with JS. This is the last thing I am going to ask you. My boss just keeps adding stuff to the form:
I tried to do another radio button like the free gift thing but it won't work. It only work one or the other. I wanted to be able to choose from different type of envelopes.
Another thing, he wants to have something like It says: Lowest interest rate and a textbox in front of it so they can just fill in the number themselves.
The last thing is something like "If you want duplex printing click here and automatically $0.5 will be add to the total.
And of course, the contact info stuff go right before the submit button.
Like I said I tried but I am just messing up. It just got more complicated than I originally offered to do, but I want to fininsh it. I'll appreciate any help I can get......
I will send you a gift certificate for a book store or some other place in England for all your help. Okay? Just let me know!

tweetie37
10-03-2003, 03:06 PM
I did exactly as you said to remove the tax stuff (I did the same thing myself yesterday!) but now the form doesn't work. Can you be able to run it your self to see what I mean? Thanks

tweetie37
10-03-2003, 03:15 PM
Sorry, it did work the way you have it set up. It is just he is not going to charge them any tax at all. so no tax involved!!! I guess I explained poorly before. Sorry!

tweetie37
10-03-2003, 04:12 PM
God darn, I am understanding your code better. I just did figure out the tax thing myself. I just panic sometimes when I can't figure stuff out.

lavalamp
10-03-2003, 08:49 PM
If you followed the instructions of deleting between the *'s and doing what that comment said, it should have worked straight away. I tried it myself and it worked.

By the way, I'm not sure what you mean by lowest interest rate, as far as I know, interest is something that you pay on a loan or earn on your savings.

lavalamp
10-03-2003, 10:51 PM
How's this? Just do me a favour and validate the page on the W3C (http://validator.w3.org/) site. You should find that the code that you posted isn't valid.

tweetie37
10-04-2003, 08:49 PM
Hey Lavalamp:
What I meant was that I just want a few text boxes so people can fill them out themselves. I just want to know where to insert the code for the text boxes. I gave the interest rate for an example..
Thanks again for all your help.

ps Don't forget to give me your address in England so I can mail you the gift certificate. I was thinking Barnes & Noble online. What do you think?

lavalamp
10-04-2003, 09:34 PM
Well you can add whatever you want to the form, as long as it is within the form tags.

By the way, about the certificate, don't worry about it. I don't help people in the hope that I might get something for free.

If there's anything else that you want adding or changing let me know and I'll be happy to help again. :)

tweetie37
10-05-2003, 05:20 PM
The last 2 things that I want to add is:
1) I want them to fill in the things they want in the text box. FOr example: It would say: Maximum rebate and in front of it would be a text box so they can fill in the rebate they want. There is going to be 4 or 5 of these things. Could I just use a text box code like the one for contact information or a JS code. My confusion is where to insert the code, I guess.
2) I want a check box that they can check and it would say:
If you want Duplex Printing, click here and add $.05/per flyer to your total.
That's it. I think my boss is done now!
Like I said I'll appreciate all your effort in this. About the gift certificate, I just wanted to say thanks for everything. You went out of your way to help me and no one else has. Please think about it and it is not because I think you want to get free stuff!! I really want to do this.

lavalamp
10-05-2003, 05:43 PM
Ok, I can do that, but first you have to tell me one thing. What's a rebate?

lavalamp
10-05-2003, 06:24 PM
Well I went away and half did what you wanted:

tweetie37
10-06-2003, 02:46 PM
Okay, what I wanted to do is just have some text boxes that customer can fill out himself. I just gave you an example. Just it would say something like(example): payments starting at: it would be a text box in front of it so he can just fill in (for example) $200 a month or something like that. It is just regular text box and I just didn't know where I should insert the code. I have this code. Would it work and if yes, where should I insert it?

tweetie37
10-06-2003, 05:21 PM
Forget the last post: I used this code for text boxes in the form. Is this going to work? If not, could you help me with the code. I want it to look like what I have here!!!
This time I tried to take the tax off your code and it is not working. I left it as is. But, my boss doesn't want to charge them tax at all so I need to take the 17.5 thing off the code (he doesn't even want any kind of tax at all) and now it is not going to work. It worked last time I took it off but with the new coding it is not going to work.
Thanks

lavalamp
10-06-2003, 06:48 PM
As long as when you're adding content to the form, you put it within the form tags it's fine. If you want to validate the form before it is submitted I can help you with that as well.
However I still need to know what a rebate is.

tweetie37
10-07-2003, 02:55 PM
I am going to use the code I have for text boxes and finish the form and let you help me with validating it. However, I still need help with taking off the 17.5 (or any tax amount) tax section. Would you let me know? Thanks again.

tweetie37
10-07-2003, 03:38 PM
You know what, I got the tax thing figured out!!! I have been sick with the flu so my mind wasn't working too well Yesterday, but I am thinking more clearly today. I am going to finish the form and let you see it and help me with validation. I still have the same problem when I submit the form. Errors! I think it is because the form is in my hard drive and not up with a host yet so submitting through my email is the problem. What do you think? Should I wait until the form is up and running to see what the problem with the submit is?

lavalamp
10-07-2003, 05:50 PM
I really don't see what the problem with the tax is, it's gone now. I followed my own instructions and removed it.
There could be several problems with the submitting of the form, if could be that you do not have outlook (or whatever you use) properly set up on your machine, it could also be many other things (none of which I can think of right now).

The best thing to do if you want to e-mail the form to yourself, would be to use a server side language, PHP is probably the best, but if you were going to use PHP then you might as well store the information in a database (MySQL) rather than e-mail it.

I'm afraid that I can't help you with PHP, I can barely do what I want in ASP, but I'm sure that there are others who can.

I'll do my best to sift through the form and see what each field needs to be checked for, (eg. e-mail needs the @ sign and a . after it). If, after I do that, you need to check for other things then you'll have to let me know.

By the way, I'm glad to here that your over the flu.

tweetie37
10-07-2003, 09:33 PM
Hey Lavalamp:
Two things that my boss wanted to change:
1) He wants more than 4 flyers now and wants them to be a thumbnail and when customer clicks on one, it shows the actual size (so it is readable!!).
2) He wants instead of Add 1000 and Use Custome Value (that is what we have right now), it be like this: "Minimum order $2500" (this one be a fixed value-- they can not order less than $2500) and then there would be "Add 1000" and another one "Add 500". So, they have to order at least $2500 and then build on that with the other buttons (add 1000 and add 500). I know, I know, this is a mess!!!!
Also, I JUST noticed that the postage only adds one time. We want it to be like duplex printing and be per flyer not added just one time to the total!!!

I am attaching the form as it is right now. Can you add it to this version and post it?
Thanks

tweetie37
10-07-2003, 10:05 PM
A mistake in the last post: I meant to say 250 flyers NOT $250

tweetie37
10-07-2003, 10:06 PM
Why am I doing this? I don't know. Again, I meant to say 2500 flyers not $2500.

tweetie37
10-08-2003, 08:21 PM
Hi Lavalamp:
Could you take a look at my code here and see what I did wrong? As I said before my boss is changing the form a little bit. Now, he wants a minimum of 2500 flyers to begin with (that will be fixed) and then the customer can add to it (Add 1000 and Add 500). The code I have does that but it only does flyer 1 and ignores the other 3 and keep listing flyer 1 information 4 times so the flyer cost is flyer 1 *4 and nothing about flyer 2, 3 or 4 listed. Can you run the script and see what I mean and help me out? Thanks a bunch!!!

ps: I still haven't figured out how to do postage (per flyer) and then add it to the total. This should be for both first class and standard(second) class postage!

tweetie37
10-08-2003, 08:26 PM
Sorry, the wrong script was posted. This is the correct version!!!

lavalamp
10-08-2003, 11:18 PM
What have you done to my beautiful script???

You have attemted to call the 2501st term of an array here, it only goes up to 4!

for(var o=0;o<how_many_flyers;o++){flyersordered[2500]["amount"]=numofflyer;}}

Also the buttons that used to add the number of flyers ordered to the textarea, no longer do so, they only add to a textbox. To add to the textarea you need to call the function add(flyernum,numofflyer).

tweetie37
10-09-2003, 02:50 PM
Sorry about messing your script. It was beautiful but he wants it done differently and I tried to do it myself. Now, I don't understand it. You mean this is correct or it is wrong?
for(var o=0;o<how_many_flyers;o++){flyersordered[2500]["amount"]=numofflyer;}}
If it is wrong, how should I fix it so the count start with 2500 flyers and then they can add 1000 and 500 if they want.
Also, where do I call the function add(flyernum,numofflyer)?
DO you mean like do: var flyernum=new Array();
and var numof flyer=new Array();
Or am I doing it wrong? I do need your help with this. I know I am asking too much, but since you have been helping me, I kind of need your input to finish this project. It has become more complicated than I thought and I apologize for it!!!
By the way, how do I do flyers as thumbnail and when they click on them, they can see bigger picture in a different page? I tried a couple of scripts yesterday, but it did it not only to the flyers but everything else in the form!!!! Just tell me where I should insert a script and I'll do it. And, did you see the postage? Am I doing it right or wrong? It also multiplies by 4 like the flyers.....HELP!!!
Thanks for everything.

lavalamp
10-09-2003, 07:58 PM
Where you want to add a number of flyers, on a button for example, do this:

add(0,2500)

Where 0 is the number of the flyer and 2500 is the number you want to add. For the custom textbox submission to the textarea do this:

add(0,"custom")

Where again 0 is the number of the flyer, but "custom" tells the script to go to the custom textbox for that particular flyer and retrieve tha value from there.

By the way, the first flyer is numbered 0, and the second 1 and so on.

tweetie37
10-09-2003, 09:26 PM
I changed the script again and this is what I have(see attachment). I am leaving it the way you had it and just added a button that says minimum order is 2500. You'll see when you run it. My boss said it is okay this way (I hope he won't change his mind again!!!!!). Anyway, can you just look at the postage part and fix it for me so the postage is per flyer and not just one time added to the total. The way I have it, where it say postage(after flyer cost), it calculates the # of flyers * 0.22 (or 0.32) but it also added another 0.22 to it. It also does the same thing to the Total cost. You'll see what I mean when you run the script. (for life of me I can't figure out why). Can you do this for me? I'll appreciate it....................

lavalamp
10-09-2003, 10:07 PM
Is this any good? It also includes a check that at least 2500 flyers in total have been ordered.

tweetie37
10-10-2003, 04:37 PM
Thanks for fixing the postage problem. I like the form the way you set it up and when you open it, it does start the count at 2500 (instead of 0) but when I click Add 1000 or Add 500 and looked at where it says: "so far you have ordered:", it shows only the 1000 or 500 flyers that I clicked at. It does not add 2500 there! I think that's the way my boss wants it. The 2500 should be automatically or the customer won't be able to order any amount unless they click a minimum 2500 button first!!
Am I making sense? If it is not possible, I just leave the form this way................
When I finish it, could you help me with the validating the form?
Thanks again for all your help.

tweetie37
10-13-2003, 10:06 PM
Hi Lavalamp:
I am back again!!! As I told you, my boss is adding more flyers to the form. I tried to do it myself but I am getting an error. How do I set the flyers 3 in a row horizontaly and again 3 in a row underneath it and so on?
Thanks

lavalamp
10-13-2003, 10:58 PM
It may not be a good idea to have 3 side by side, (or even two side by side), when your images are that big. For those on smaller monitors it would cause them to have to scroll horizontally.
To add another flyer to each row is simply a matter of CSS and a few calculations to get the positions correct. If you are not up to speed with CSS you should get a book, read it and then start messing around, it's no use just trying stuff to see if you get a favourable outcome.
I only presented the page in that way to give it some form of structure rather than looking like a mess. There's no rule that says you have to keep it that way, you may prefer to use tables to set out you page, although I suggest that you stick to CSS.

To add flyers to the script, look throught it to find places where it seems like you should add stuff, like here:

var how_many_flyers=4;

change it to this:

var how_many_flyers=5;

and here:

flyersordered[0]["price"]=0.39;
flyersordered[1]["price"]=0.39;
flyersordered[2]["price"]=0.39;
flyersordered[3]["price"]=0.39;

to add another one do this:

flyersordered[0]["price"]=0.39;
flyersordered[1]["price"]=0.39;
flyersordered[2]["price"]=0.39;
flyersordered[3]["price"]=0.39;
flyersordered[4]["price"]=0.39;

They are the only two script places, for your image and flyers, add this for flyer number 4:

<div class="container">

<img src="5.gif" alt="Flyer 5" class="thumb"><br>


<input type="button" onclick="add(4,500);return false;" value="Add 500" name="add40" class="inputadd" disabled="disabled">
<input type="button" onclick="add(4,1000);return false;" value="Add 1000" name="add41" class="inputadd" disabled="disabled">
<input type="button" onclick="add(4,2500);return false;" value="Add 2500" class="inputadd"><br>

<input type="button" onclick="add(4,'custom');return false;" value="Use Custom Value" class="inputaddcust">
<input type="text" onblur="this.value=checkval(this.value);return false;" name="flyer4custval" value="2500" class="inputcust">

</div>

tweetie37
10-14-2003, 03:01 PM
Thanks for the suggestion on CSS. I will get a book and read it. The flyers are all thumbnails now and not the large version I had. That is why he wants more than 4 because they are thumnail and when click on them, you get the larger version...... That's why I was thinking to have them 3 in a row!!

tweetie37
10-14-2003, 04:32 PM
I did as you said to add another flyer and so on. but, how do I extend the height of the area the flyers are in? the 5th flyer went into the free gift area!
Thanks again

tweetie37
10-14-2003, 06:54 PM
Big problem!! My boss is changing everything now.He wants to charge people those gifts. I have changed the script to do this but I am missing something. WOuld you be kind enough to look at it and tell me what is missing.
WE are charging $6 for each gift and they are in bulks of 50, 100, 150 and a use custome value so they can pick what they want. So, 50 gifts for $300 and so on. Is that make sense? I hope so...
We should have:
Flyer cost: Gift cost: Postage: Duplex Printing: Total Cost:

Thanks

Willy Duitt
10-15-2003, 03:10 AM
Originally posted by lavalamp
Ok, I can do that, but first you have to tell me one thing. What's a rebate?

Lavalamp;

Did you ever find out what a Rebate was? LOL

...Willy

lavalamp
10-15-2003, 12:14 PM
No I don't think that I ever did. Do you know?

I would start working on that script to get it working, but there are a few things against me right now. I'm at school, so the PC's are crap, I hate the keyboards, the mouse doesn't have a wheel also I don't have much time right now and I only want to sleep.

Maybe when I get home.

Willy Duitt
10-15-2003, 12:22 PM
A rebate is a post purchase discount.

lavalamp
10-15-2003, 08:37 PM
Why not just lower the price?

tweetie37
10-15-2003, 09:29 PM
Hey Lavalamp:
Did you have a chance to look over the form? I'll appreciate it. I'll post it agian. I am treating the gift (I guess I shouldn't call them gifts anymore) just like flyers. You'll see when running the script except my calculations are not right!!
I want the form to say something like this:
You have ordered 150 clocks at $6.00 ea. That's $900.
Then it would list at the end: Flyer cost: Gift (or insentives) cost: Postage: Duplex Printing: Total Cost:
Thanks for your time and effort in this. I'll promise this is the last thing..

lavalamp
10-15-2003, 10:13 PM
I did have a chance to look over it, and it seem that you have used the name giftr a lot instead of gift, so that's one thing.
Then of course, there's always the simple matter of having two identical functions:

function add(flyernum,numofflyer){

function add(giftnum,numofgift){

You cannot have more that one function with the same name. Also you deleted a closing brace (}) for the first function which threw up many errors.

Also, the bit that updates the textarea is now in the second function, so that even if the first one worked, there would be no way to see it working. Actually what it does do is add to the free gifts ordered rather that the flyer as it refers to the second add() function.

Both of these functions need to be rolled into one, and that's going to take time, so don't get so anxious. You should be able to see that I've downloaded it from the little 1 next to the attachment.

Why do I get the feeling that you've opened the page in a program like Frontpage or Dreamweaver? Oh that's right, all of the code has bee f*ck*d up. Including the CSS. Honestly why do people use those things.

Oh yes, I almost forgot, because the flyercost never gets above 0, the submit button is never active.

I'm going to go away now and start from the previous version I posted, and modify it in such a way as to replicate what I think you want, which includes hiding the gift section until they've ordered some flyers.

By the way, why would anyone want to buy 150 clocks?

Sorry I've been harsh but I'm in a bad mood.

Edit: I also need to know what EXACTLY needs to be checked for in the form, on a field by filed bases.

tweetie37
10-16-2003, 03:20 PM
As far as checking for fields, anything that has a * by it, needs to be checked (such as their name, address, etc) to make sure it has been filled by the customer before they can send the form. Is this what you are asking about the fields?

lavalamp
10-16-2003, 07:18 PM
Not really, but I guess what you're trying to say is that all the required fields must be not empty. I was thinking that you may want the date and time would have to be written in a certain form, eg 18:11.
You would be better off, for the dropdown menu state picker, to have the default option as "Pick A State" or something like that, so they are forced to pick one.

Also, I would recommend opening a pop-up window when the submit button is pressed which they can print from, that way the information entered can be displayed as text rather than in form fields.

It would be better to use a server side script for this order form. There are a couple of reasons for this, firstly you could put the correct date and time on the page no matter what the users computer clock says. Also the e-mail would be sent from the server to you, so it would always be from the same address which means you can set a filter on your e-mail so that you don't have to sift through your junk mail each time you look for orders.

tweetie37
10-16-2003, 08:20 PM
Do you mean PHP for server side script? I am doing research to see if PHP is for us. The host should support PHP, correct? Our host is Tripod and I havn't seen anything on there about PHP!! Could I just use "mailto:" for submission? Any suggession on that pop up widow you told me about?
As for time and date (Are you talking about "Date of event" & "Time of event"?), the customer has to fill out their own time and day. It is their event we are helping them with.
In case you are wondering: This company is a direct mail advertising comany which serves car dealerships. The dealerships can pick the flyer they want with all the details (including lowest interest rate, maximum rebate and etc) on it and we mail the customers this flyer and invite them to come and buy a car! The gifts are for dealerships (we charge them) and they give them away to their customers. That's why it was a little misunderstanding about free gift VS charging them (with my boss) and I though it is free.
Anyway, I hope I am being clear..
Thanks again

lavalamp
10-16-2003, 09:45 PM
I thought that the date and time of event was the date and time that they filled in the form. Guess not.

I suggested server-side e-mail because client side e-mail assumes that the client has their e-mail program set up properly on their machine, I know mine isn't, I don't use Outlook express.

I personally only know some ASP and I would need to do a lot of reading up on how to send the e-mail via ASP. I have heard that PHP is better at this sort of stuff but I don't have any experience with it. I'm sure that some other people in this forum could help you with it.

I also don't know anything about Tripod, I've never used them before. You would have to read up on the website about the type of hosting you have.

tweetie37
10-20-2003, 03:45 PM
Hey Lavalamp:
Are you having any luck with that script? I know you are busy with school work and it must be around mid-term exams. Good luck!
Let me know. Thanks

lavalamp
10-20-2003, 06:42 PM
We don't have mid-term exams over here. We get January and Summer exams (for A-Level at least). Instead of mid-terms we just get shed loads of work to do over the holiday.

I've posted what I've got so far.

tweetie37
10-20-2003, 10:00 PM
The flyers are perfect but the gift section doesn't work! I clicked on Add 150 or any of them and nothing happens. It say the gift is poke in the eye.. (I noticed in the script, you still have gift description["poke"]="free gift-poke in the eye"; and var chosen="poke" listed). I am lost as why you left them there...
Thanks

lavalamp
10-21-2003, 06:23 PM
Originally posted by lavalamp
I've posted what I've got so far. [/B]

I know very well that the gift section doesn't work, that's because I haven't started writing the script for that section.

tweetie37
10-21-2003, 09:52 PM
Sorry, I didn't mean to complain!! I am just having a bad day. Not you.....

tweetie37
10-23-2003, 05:30 PM
Hi Lavalamp:
I am sorry to bother you and I know you are busy but my boss is really getting on my case about finishing the order form. He wants to see it on Monday Oct 27th. I'll appologize again for inconvenience... I can not finish the form without your script for the gift part (of course you knew that!!!!). Please let me know if we can finish this by Monday or I have to think of something else to do with the form.
Thanks again.... You are a nice guy...

lavalamp
10-24-2003, 12:21 AM
Sorry about causing you all this stress, but you can tell your boss that there is no need to worry, the latest I'll post the script will be on sunday, but I will most likely post it on friday evening GMT time. That will probably be sometime in the afternoon for you, (I assume that you live in the USA and are running on Central time, GMT -5hours).

lavalamp
10-26-2003, 10:57 PM
Here you go, how's this?

tweetie37
10-26-2003, 11:19 PM
This is perfect except the first class postage & duplex printing does not work!! It gives me error everytime I change postage to first class and add duplex......
And, the gift section doesn't need postage added to it.

lavalamp
10-26-2003, 11:26 PM
I'd forgotten to change something in the onclick event handler for the input radio buttons. It should work now.

tweetie37
10-26-2003, 11:54 PM
Eveything is perfect except the gift total is not right. I put Add 150 and it gives me $900(which is correct and it should be $900 for the Total gift cost) but where it say Total gift cost it give me $90000 instead of $900.

tweetie37
10-26-2003, 11:57 PM
Ops, I forgot!! The overall Total cost only gives the Total flyer cost. It doesn't include tht gift total.

lavalamp
10-27-2003, 12:06 AM
Maybe I should have done a little more testing before posting. Hows this:

tweetie37
10-27-2003, 12:21 AM
Thank you so much for fixing it so quickly. Everything works perfectly now. I will show this to my boss tomorrow morning and hopefully this be it. I'll let you know. Thanks again. I might want to add 4 more flyers to this. I can just change the # of flyers, right? I probably (if he okays this) are going to put it online and try to see about submission. Do I need to do anything else before I transfer the file online?(exept validate the coding?)

lavalamp
10-27-2003, 12:26 AM
Well I would prefer it if you didn't use tables. I could create some CSS for it and post it in about an hour (maybe), I don't suppose I would need to write very much if it is only to position a few text boxes.

Apart from the code you specifically wanted including, everything should be valid.

tweetie37
10-27-2003, 02:37 PM
That sounds great if you don't mind.....

tweetie37
10-27-2003, 06:41 PM
Hi Lavalamp:
I am going to kill my boss ( I am so upset). I loved your order form and he knew from beginning that is the way we are setting it up. Now, he says it is not simple enough for his customers. This is what he wants changed. Tell me if you don't want to do it and I understand.
Where it says "so far you have ordered......", he wants it to show only the items they have ordered. For example if they have ordered 2500 of flyer 2 at $.39 each. That's is $975.00 and The gifts and the postage and all that. He doesn't want it to say: 0 of flyer 1, 0 of flyer 3, etc... Just what they have ordered! He wants this section of the form that shows what they have ordered in a separate page (like a confirmation page) that lists everything they have so far. The tricky part (to me) is that he doesn't just want it to say "you have ordered: 2500 of flyer 2, 150 of gift 1, etc..." He wants the picture of the flyer and the gift and the envelope show up there instead of the number of the flyer, etc.
And, the submit button goes in this page and they only submit the confirmation page. He also wants the option of "print this order form" so if they don't want to fill in the form, they can print a blank copy of the form and mail or fax it to us.
Is any of this stuff doable? I am so sorry about this. I am so upset and I am about to cry here and I know you have put time into this. Let me know... Thanks

Willy Duitt
10-27-2003, 06:56 PM
Seems to me, you should give your boss Lavalamp's contact
information so he can make arrangements to put him on the
payroll. It's quite obvious Lavalamp has devoted alot of time to
this project out of the goodness of his heart. I bet if your boss
was paying to have this done, he either wouldn't be making so
many changes or he would be concise on what he wanted.

I don't mean to hurt anyone's feelings but I have
followed this from the beginning, is it ever going to end?

....Willy

tweetie37
10-27-2003, 09:22 PM
Hey willy:
Lavalamp is doing me a favor knowing I don't know much about JS and CSS. I'll appreciate his work and time in this project. And, yes I think this is the end.... I really didn't think the order form would be like this when I offered to do it but when I start a project, I rather finish it!!! and lavalamp has been great. I think he is the nicest guy around this forum. He really stuck with me knowing I really needed help..

Willy Duitt
10-27-2003, 09:26 PM
Yes he is, and yes he did!

lavalamp
10-30-2003, 06:32 PM
Originally posted by tweetie37
lavalamp has been great. I think he is the nicest guy around this forum.
Originally posted by Willy Duitt
Yes he isYou're both so gracious. :D

That's a pretty big change that he's requested, I don't think that this is do-able by tomorrow.
It will cut loose about half the code (the bit that writes the into the textarea), but I could re-use some of it in creating a pop-up window for the current order.

The problem with a setup like you want is that, whereas now it's still marginally customizable (with all of the arrays), if I go all out for the pop-up and millions of systematicly named arrays, the code will become completely lavalamp-ized and for anyone else looking at my code, they will just see a block of uninterporable mess.

Also, do you want the customer details form on the page or in the pop up (please say on the page), I think that it would make more sense to have it on the page. There could be a button that says "What have I ordered?", then whan they click it, if they have also filled out the form properly, in the pop-up there would be a button saying "Submit this order.". When clicked, it would close the pop-up and submit the form.
As for printing off a blank form to fill in, they could just print the page as soon as it loads, no fancy JavaScript there.

By the way may I ask, what company is this for?

tweetie37
10-30-2003, 06:55 PM
Hey lavalamp:
I don't know if you got my PM. I didn't know what happened to you so I PMed you!!
I convinced the boss not to change anything and leave it except instead of saying flyer 1, 2, etc, I thought to name them and when the customer sees the total at the bottom, instead of saying you have ordered 2500 of flyer 1, it would says the name of the flyer. THe same deal for the gifts. Is this possible? Please say yes...
I have named the flyers: #1(Nada Buy Back), #2(Authorized Super Sale), #3(Program Headquarters),#4(Inventory Clearance), #5(Acquisition Sale), #6(Millionaire).
Thanks and let me know...

lavalamp
10-30-2003, 07:00 PM
I read your PM, I just didn't know which you had sent first (didn't check the times), yes it is possible. To customize what it says in the textarea, look for this:

discription["flyers"][0]="Flyer - Flyer 1"; // For each flyer give a short summary to appear in the textarea.
discription["flyers"][1]="Flyer - Flyer 2";
discription["flyers"][2]="Flyer - Flyer 3";
discription["flyers"][3]="Flyer - Flyer 4";
discription["flyers"][4]="Flyer - Flyer 5";
discription["flyers"][5]="Flyer - Flyer 6";

discription["gifts"][0]="Free Gift - Clock 1"; // For each gift give a short summary to appear in the textarea.
discription["gifts"][1]="Free Gift - Clock 2";
discription["gifts"][2]="Free Gift - Clock 3";
discription["gifts"][3]="Free Gift - Clock 4";
discription["gifts"][4]="Free Gift - Clock 5";

Now the script itself:

tweetie37
10-30-2003, 07:09 PM
Thanks for getting back to me so quickly. Is there any way to not show the other flyers they haven't ordered. Just say you have ordered 2500 of Nada Buy Back (name of the flyer) and that's it. Just what they have ordered? That probably requires to rewrite the script, right? If it is too complicated, forget it...
By the way, to answer your question: this company does direct mail for other companies such as dealerships.
Let me know.

lavalamp
10-30-2003, 07:46 PM
Is this better, or would you like to remove the gift total if non are ordered as well?

tweetie37
10-30-2003, 08:35 PM
This is wonderful. YOu are a guiness!! But it doesn't show how many gifts they have ordered. Like says 150 of clock 1 at $6.00, that's $900.
They are going to order gifts and if they don't we leave it as is so they have the option.

tweetie37
10-31-2003, 04:30 PM
Another question:
How do I clear the whole form? What I mean is that right now when I hit Clear form, it only clears the area that has all the orders(so far you have ordered....). It doesn't clear the flyer and gift area (the number they have picked to order). I hope I am making sense here!! Thanks.

tweetie37
10-31-2003, 08:42 PM
Sorry to bug you but beside those little problems I posted before, I got another one. Could you take a look at this and see why I get an error on the page. This is what I am doing:
I want to put a picture where it says "2-sided printing (duplex printing)..." so it shows the back of the flyer (this is just another flyer) so this is showing a 2-sided printing. That is where I get an error.

lavalamp
11-05-2003, 12:12 AM
Sorry for not replying but I didn't realise that you had replied. The e-mail notification system must not be working (either that or I skipped over the e-mail by accident), anyway I'm here now.

I'll have to take a look at what you posted and try to iron those bugs out.
By the way, who said I didn't like pm's? I suppose that I could have said that myself, if I did I take it back. It's just that if I do anything wrong in a pm, there's no-one there to correct me. Also you can't attach stuff, but that's only a minor downside.

tweetie37
11-05-2003, 03:05 PM
I am going to tell you the bugs again since you might have missed my PM. Actually, I fixed a couple of them myself. I got it to say the gift order just like the flyers. Also, the bug in duplex printing is fixed. The only thing that I didn't know how to do is to clear the whole form. It only clear the order part. It doesn't clear the actuall amount they put in at the flyer and gift section( you know where they actually add 1000 etc). Another thing that I thought if it is possible to do is at the order section, it would say standard or first class postage (if it is not too much trouble). Also I did a test and send the result to my email address and this is what I got:

flyers2custval=2500 //how can I get rid of this part??
gifts0custval=0 //how can I get rid of this part??
gifts1custval=0gifts2custval=150 //how can I get rid of this part??
gifts3custval=0 //how can I get rid of this part??
gifts4custval=0 //how can I get rid of this part??
p=on //how can I get rid of this part??
e=on //how can I get rid of this part??
d=on //how can I get rid of this part??
ordered=So far you have ordered:
2500 of FLyer3 - Program Headquarters, at $0.39 each.
That's $975.00
Flyer Cost: $975.00
Postage: $550.00
Total Flyer Cost: $1525.00
Envelope Type - White Important Documents
Total Gift Cost: $900.00
Overall Total Cost: 2425.00
rebate=
interestrate=
savings=
discounts=
payments=
downpayment=
DealerName=aim
ContactName=morgan
date=nov10, 03
time=10am
MailingAddress1=401 ware blvd
MailingAddress2=
City=tampa
State=alabama
Zip=33615
Phone=8136555555
Fax=
Email=morgan@roverwireless.com
Addressflyer=
Message=
submit=Submit

Thanks. Let me know.

tweetie37
11-05-2003, 08:53 PM
One more thing I thought of:
How can I get rid of the spaces between the lines in "so far you have ordered:"? There is a huge gap between the lines when they get listed.. Is "gap" in the script the same as <br> in HTML? I did try to take the gap out, but it gives me error. What does gap do?
Thanks

tweetie37
11-10-2003, 05:44 PM
Hey Lavalamp:
How is it going? I have one more little question:
Is there a way to just print everything below "so far you have ordered" section and not the whole order form? We have this at the bottom of the page (click here to print and fax it to us). can this code be moved up the page? or how can it be done?
Thanks

ivanhoe
11-11-2003, 11:25 PM
Sorry for the intrusion~

I think "lavalamp" could help me since I posted twice my problem
concerning a problem here in this forum with a submit form that needs an evaluation.
The script is okay except the part submit button that leads nowhere. I tried everything else but when the submit button is
click it does not work even trying everything else out there.
It can either go to an email address but preferrably to a shopping cart once every field is enter.

Hope you can take a time out here and help me.


thanks in advance!

:confused:

lavalamp
11-14-2003, 10:02 PM
This should now work for non-js and js enabled browsers, it's just that if the user has js, the results of the form will be presented to you in a more appropriate manner.

I have included a little hidden input field that will let you know whether the user had JS enabled or not, it should appear in the e-mail as the first field entry in both cases. It's supposed to act a bit like a title.

I created some CSS and utilised some div tags to re-code your table (by the way, you had a hex value of #fffffff, there are 7 f's there, in a hex value there can only be 6).

I also removed the JavaScript and CSS into separate files, the page source was getting a little too long to keep wading through every time I wanted to find something. I hope you don't mind.

Let me know if there's anything that needs changing about it.

By the way ivanhoe, I still need to see some code if I'm to help you.

lavalamp
11-16-2003, 11:51 PM
I hope that I'm not bugging you, but was the last script OK?

tweetie37
11-17-2003, 02:59 PM
I just looked at your script. When open, first of all, it gives me error and there is not the section that tells them what they have ordered!? I am a little confused about the script. There was a coding by itself on the zip folder which I don't understand. Why is it seperate? Could you walk me through this? I am confused...
Thanks

tweetie37
11-17-2003, 03:06 PM
I understand you put CSS in seperate file but what do I do with it? Could I insert it in my file or has to be seperate? I don't know what to do? I am not familiar with what to do to with seperate files? It sounds stupid to someone like you, huh??

lavalamp
11-17-2003, 05:57 PM
Whe you unzip the folder there are three files (which need to be kept in the same directory folder). One of them is the .html file, another is a .js file that includes all of the script and the last one is a .css file that contains all of the page styles.

The reason that I separated the files out was simple, the actual page source got too long. I kept having to search through to find the styles and the script. The separate files solve this problem, all you have to do is upload all three to the same location.
Alternatively I could put the CSS and JavaScript back into the .html file, but this makes it harder to modify.

If, when you unzip the folder, you just open the .html file as it is there should be no errors of any kind, there are none at my end.

tweetie37
11-17-2003, 06:02 PM
the html file is the one gives me error when open. Also, I can't open the js file (it is in some kind of netscape version) and i don't have netscape. There is not a way to put all the files in just the html file (even if it is long)? I understand it better...

lavalamp
11-17-2003, 06:11 PM
Who said anything about opening the .js file? All you have to is open the .html file as normal with the .css and .js files in the same folder as it. Just do what you did last time, there really isn't any way that I can say it simpler than that.

Do you use windows? If so then I know that this WILL work for any version above Win 95. I can't verify that it will work for other operating systems but there's a 99.9% chance that it will.

In any case here's the single file. The print button prints everything, if you want it to print just what is in the text area and the contact info that will involve the use of a pop-up window.

tweetie37
11-17-2003, 06:25 PM
I guess what I was confused about was that why do we need 3 seperate file (in one folder, I understand). Because the form looks the same to me and does the same thing!! And how do you clear the whole form. It doesn't do it. Am I making sense here??
Yes, I think I need a pop up window. He really just wants the text section only to be printed.

lavalamp
11-17-2003, 06:29 PM
So you want JUST what is in the textarea to be printed? I can do that no probs.

By the way, that reset button does reset all of the form fields, I fixed that bug.

tweetie37
11-17-2003, 06:34 PM
I am sorry I just tried again. It works. You are a guiness... Yah, just be able to print what they ordered along with their contact info and that rebate section.

lavalamp
11-17-2003, 09:34 PM
OK then, here it is, version 18.
It comes complete with a print form button that opens a pop-up window. The pop-up window uses some clever trickery to show all of the required fields (filled in or not), but only the non-required fields that have been filled in. It also highlights in red which of the required fields still need to be filled in.

Who would have thought that there would be 18 versions of this script? I know I didn't. I hope your boss likes this one, otherwise we could be looking at version 19.

tweetie37
11-17-2003, 10:38 PM
Oh my god, this is so clever!! I love it. I'll show it to the boss and let you know....Could the section of Maximum Rebate & Lowest interest rate be included in this?

lavalamp
11-17-2003, 10:53 PM
They are included, but because they are not required fields they don't show up unless you put something in them.

Glad you like it though. Maybe this will be the last version after all. :thumbsup:

tweetie37
11-17-2003, 11:28 PM
I tried the Maximum rebate and it was perfect (it was included) but Interest Rate won't show up in that section.
He added 6 items to that section that had Maximum rebate. So including maximum rebate, I have 6 text boxes and one big box that says additional information. Could we include these in printer friendly section? How do I add them? Am I making sense?
Thanks

lavalamp
11-17-2003, 11:48 PM
You could but the script gets a little complicated around that area. I'd have to have a look at them so that I can include them in the script.

Version 18 revised:

tweetie37
11-18-2003, 08:19 PM
Okay, this is what we have for that area which is called FLYER CONTENT :
Maximum Rebate
Lowest Interest Rate
Savings Up To
Discounts Up To
Payments Starting At
Minimum Down Payment
Additional Information Such as: LOGO OR SLOGAN //this one needs to be in larger textarea.

Thanks

ivanhoe
11-18-2003, 10:24 PM
Lavalamp, thanks for the reply!
Do you mind if I send this code to you via your email address.
Forgive the ignorance and I am not a computer sobby and I don't know exactly how to zip a file. The code is too long for me to post it here and that perhaps no one ever had the patience to look at it here!

thanks again!

Ivanhoe

lavalamp
11-18-2003, 11:30 PM
tweetie37 - I'll have at look at creating those sections.

ivanhoe - If you upload a .txt file of what you have to one of your previous threads and direct me to it (with a link) I'll have a look but please do not send me code via e-mail.
To zip something just go to http://www.winzip.com/ and download winzip for free, then install it and from then on you can just right click on your files and click on "Add to blah.zip". If you have a lot of files, put them in a folder and zip the folder.

tweetie37
11-19-2003, 06:58 PM
Thanks.
2 questions: 1) How do I change a font size? I mean when I opened your script (by the way it is wonderful) and put my images and all that in, where it says "click here to go to printer friendly ordre page", the font is very small and not readable. Yours was fine and I didn't change any font sizes. I just added some titles(choose your flyer, etc) but didn't do anything with the font. Is that has to do with it?
2) How do I make "Select Quantity" be abled not disabled? I just want it to be visible so when the page opens, customers can read it and select what they want.

lavalamp
11-20-2003, 12:00 AM
Changing the font size will be harder that you think, you could do it in one of two ways, firstly you could do this:

Find this bit of code:

if(window.print){
document.writeln('<div class="giftgroup" ...

just after that put style="font-size:20px;" or some other size.

The other way is to find this bit of code:

.giftgroup{margin:10px;}

and do this to it:

.giftgroup{margin:10px;font-size:20px;}

or some other size, but make sure that you leave in the px (they are the units of the size, other units include; pt, %, em).

I have included the modified script with the appropriate buttons enabled on start-up.

By the way, in the case of using mailto: instead of your PHP script, DON'T. mailto: doesn't work at all on my PC and the chances are that it won't work on other PC's either unless they happen to have Outlook Express (or whatever) configured correctly, I don't use Outlook Express so I don't give a toss about it, as far as I'm concerned it's a waste of HDD space.
If at all possible, use some sort of server-side script (ASP, JSP, CGI, Perl etc.) to send you the form results, if that just isn't possible with your current host, switch.

ivanhoe
11-20-2003, 02:13 AM
Lavalamp, kindly look at my profile and you'll find it at my homepage, thanks in advance!

tweetie37
11-20-2003, 03:03 PM
Thanks for replying and fixing the problems. Could you tell me how to get the server side script? Should I be looking for a company that would do it for me and send the form to my email address? Is this what you mean? Thanks

tweetie37
11-20-2003, 03:44 PM
Hi again:
I went to our host and this is what they offer for CGI. Is this what you mean? Can we use this? How do I do it? Thanks

TripodCGI is a module to help you deal with CGI input, which is the kind of input your script can get from forms (as well as from specially-coded links). When you have a form submit its information to your script, you can use TripodCGI to grab some or all of the inputs that the form provided, so that you can use them for your own nefarious ends ;)

Of the functions below, the only two that you are likely to need to pay attention to are param() and redirect(). param() is the function which lets you grab CGI input. If you specify the name of a particular input that you want to grab, param() will grab the value associated with the input of that name. So if I have a form with a text input box named 'address', and somebody types in '160 Water St.' and hits the submit button, I can assign '160 Water St.' to the variable $form_address within my form with this statement:
$form_address = $CGI->param('address');

If you just want to know all of the names of the inputs returned by the form, don't specify an input, and the names of all the inputs will be returned as an array - like this:
@all_inputs = $CGI->param();

The other function you might want to use is redirect(). redirect() lets you specify the URL of a page or script that you want to move your visitor to. You could use it like this:
$CGI->redirect('http://www.tripod.com'); <- redirects to the Tripod
front page

lavalamp
11-21-2003, 12:34 PM
I can't code in CGI, I just know of it. It's the same with all other server-side languages although I know a little ASP. I just know of them, so I can't help code an e-mail script.

If you were to go into the CGI forum and ask for a simple script that would just e-mail some form results to you that would be all you would need. All of the input text fields have names so that's no problem. The only difference between the JavaScript and non-JavaScript forms is that with the non-JS form the results will be submitted from a form called ord and from the JS form ord2.

Once you have the simple script simply change both form tags (one is in the JS section inside a document.write):

<form method="post/get" action="mailer.cgi"...

tweetie37
11-21-2003, 06:52 PM
Thanks for the information. I'll look into it today. I have a question about that Select Quantity button. My boss also wants to add a button for 10000 and one for 5000. Could I add those and the Select Quantity & Add 2500 buttons would be still visible? Could you just give me the code for that? I am a little lost with the new code... I asked for it, didn't I???
Thanks again for all your help. Let me know.

tweetie37
11-25-2003, 09:06 PM
Hey lavalamp:
I have a little problem:
As you suggested we are changing our host but my boss didn't want to have it done this week. I left the order form as it was without the pop up window and have the result to come to our email address. Now, it is not working!! Could you take a look at the attachment and see what needs to be changed for now so the result can come to our email address. I'll appreciate it if you let me know soon. Thanks

lavalamp
11-26-2003, 06:35 PM
The only thing that I could find not working was this:

<DIV>MAILING ADDRESS<BR><INPUT size=26 name=mailingAddress1></DIV>

which should be:

<DIV>MAILING ADDRESS<BR><INPUT size=26 name=mailingaddress1></DIV>

because JavaScript is case sensitive the a needs to be lower case. If there is an error there should be a little yellow warning icon in the status bar (in Internet Explorer at least), double click it to see the actual error. In this case, what I posted above was the only error.

By the way, why has the code been "machined"? Was it because you wanted to add the input's in the rebate section? If that's all it was then I'll change the other (non-machined) script.

ivanhoe
11-27-2003, 01:15 AM
Lavalamp,
just wondering if you had a chance to look at my problem.
Please let me know if you can or not, thanks.

lavalamp
11-27-2003, 07:11 PM
This may sound a little odd but could you send the script again, preferably in a text file (.txt) and uploaded to a post, I think I lost it :D.
You could upload it to the one I just replied to. I doubt that the source code will rise above the 50Kb limit for attachments.

ivanhoe
11-30-2003, 10:34 PM
Lavalamp, In my profile and you may see the text file at my homepage. Hope to hear from you soon. Thanks~

tweetie37
12-01-2003, 07:57 PM
Hey Lavalamp:
I don't know what you mean by script being machined!! I followed your coding and added items to the rebate section. Did I do it wrong?
So, what I have posted (the txt attachment) should work for right now without the pop up window and I should get the results coming to our email? Correct? What I got was an attachment called postdata and it was an att file. I couldn't open the attachment...What does that mean?

lavalamp
12-03-2003, 12:32 PM
Hi Ivanhoe, see the other thread for my reply.

Hi tweetie, by machined I meant that it looks as though you have used some sort of computer program (like frontpage), to alter the source for you rather than just using notepad.

Try opening your attachment in notepad or wordpad, it should just be a text only file and they should be able to handle it. If not then you'll have to play around with the settings in PHP to get it to attach the file as something else, or perhaps just get it sent to you in the message rather than as an attachment.

The actual script works fine though but I thought you wanted the pop-up window as well?

tweetie37
12-03-2003, 03:15 PM
Hey Lavalamp:
We switched the host yesterday and they handle the order form now. It is the latest version with the pop up window and all...
The web site is up and running now and the order form works well. I think, by god, we are finally done with this project. I don't know how to thank you again. Please let me know if you changed your mind about that gift certificate yet!! I honestly want to do something for you...
Thanks and talk to you later.

lavalamp
12-03-2003, 09:48 PM
Not quite finished, this is the newest of the new. It includes all of those rebate things put in the pop-up and all of the pictures have been updated (there were a couple that still didn't have sources ie: a couple were still abc.jpg). Other than that it seems pretty well done to me. Fixed a bug by the way, can't remember what it was but I fixed it all the same.

tweetie37
12-05-2003, 03:09 PM
Thanks lavalamp. I got your latest version. It is great. If in the future my boss wants to add or change something, would it be okay to contact you if I couldn't figure it out myself?

lavalamp
12-05-2003, 06:12 PM
Sure thing, but it might be best to do it on the forums. If you e-mail me your e-mail might get sent to the Junk Mail. If you put it on the forums other people might also be able to help you out if I'm not there.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum