Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
form textarea size adjustment
Old 01-13-2009, 10:22 AM form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Okay, so I want a textare/box that people can type in a string of text, have it E-mailed me.
However I found a simple input type="text" was to small, and i wanted to make it bigger. When I make it just a textarea (no input type) it allows me to adjust the cols and rows, however it won't display the submit button to submit the text. On the other hand, as input type="textarea" it won't allow me to adjust the rows and cols. I left in the surrounding text (I have it formatted in a table for design) as I thought maybe it might influence it- however I can't see that happening. The rest of my script works perfectly (and if you need to see it it can be found at http://www.factl.majooka.com/contactus.html )

<table width="800" border="0" align="center">
<tr>
<td width="38%"></td><td>
<b>Avi Zolty</b><br>
<i>Site Director</i><br>
<input type="button" onclick="func3()" value="Find out Email Adress">
<form name="isser" method="POST" action="emavi.php">
<input type="textarea" name="avitxt" rows="3" cols="20">
<input type="submit" value="Send!">
</form>
</td>
</tr>
</table>
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-13-2009, 10:37 AM Re: form textarea size adjustment
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
textareas aren't supposed to go "input type=textarea"! How did you even get it working in the first place (you probably didn't, properly).

it's like this
Code:
<textarea name=matthew rows=2 cols=12>
stuff already in my text area,
but i can leave it blank if i want
</textarea>
at least it used to work like that when i was a child - I dunno about all this newfangled stuff. demicrats. and who is this obama guy? are you sure osama hasn't just switched a letter?
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 11:54 AM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Haha, Oooh!
Thanks a lot!
Ugh, Stupid mistake .

And Haha... While we're at it, why not blame Obama for my mistake?

(If you visit my main domain [majooka.com] you will see I am a republican as well )
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 12:07 PM Re: form textarea size adjustment
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
Ah tis a playsure, zolt, me hearty. To be honest I've done made that mistake a number of times in my weary life, oh yes. At least half a dozen. It's easy to forget that textarea's demand special treatment. Do you know you can change the colour and style inside them - the bg, the fonts, everything - make it look REAL smart and dandy, don't ya know.

I'm just kiddin about osamabama - I'm just jealous coz we don't have one in England. We got gordon, and he's scottish - which is almost half way to black, I suppose.

Last edited by witnesstheday; 01-13-2009 at 12:10 PM..
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 12:11 PM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Hahaha, Nice.
:P
I'm now editing the value in the text area, how do I make a line break?
/n isn't working.
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 12:20 PM Re: form textarea size adjustment
stevej's Avatar
Professional Multitasker

Posts: 996
Location: Not positive
Trades: 0
Instead of using a <br /> tag, which would seem logical, just press return on you keyboard.

- Steve
stevej is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 12:26 PM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Wow thanks alot *gives talkupation*
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 12:34 PM Re: form textarea size adjustment
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
next answer is probably going to be;

"use nl2br()"

__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-13-2009, 12:47 PM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Haha thanks Christ, but I already knew that ^_^.
Besides, this string is getting E-mailed directly, and as far as i've seen most E-mail protocols don't read the <br>.. or any HTML tags.
But for future reference, if people write in my text area, will nl2br() be able to recognize the 'enters' as \n even though it isn't actually written there?
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 01:14 PM Re: form textarea size adjustment
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Besides, this string is getting E-mailed directly, and as far as i've seen most E-mail protocols don't read the <br>.. or any HTML tags.
If sent as a plain text email they don't, but if you send it as HTML mail they do.

Quote:
But for future reference, if people write in my text area, will nl2br() be able to recognize the 'enters' as \n even though it isn't actually written there?
Yep, because it is ALL the ASCII characters it reads from the form field not just the visible ones.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-13-2009, 01:31 PM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Nice
And how do you send as an 'HTML' mail rather than plaintext? (sorry, for all my silly questions- i've only been scripting for about a year now. and i've been teaching myself HTML, CSS, Jscript, PHP, mySQL, and stuff about how things work/fit together (like protocols) all by myself.
Actually, that's not true. You're teaching me most of things I learn (your always the one that helps/ answers my questions).
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 01:38 PM Re: form textarea size adjustment
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
by the way, we have a messiah in our midst - Christ was just thanked here on this thread for helping out.

btw i think in perl the way to get it to send html instead of text mail is
print SENDMAIL "Content-Type:text/html\n\n";


which is no good 2 u since you're not digging perl yet - but hey, you're 100% self-taught. so maybe one day you'll give it a try. perl.org is a good place to start.
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 04:13 PM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Haha, my bad :P
and I'll definitely have a look at it, I mean i've obviously heard of it- never bothered to learn. Thanks for the advice
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-13-2009, 04:53 PM Re: form textarea size adjustment
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
any time Avi.
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 04:11 AM Re: form textarea size adjustment
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
http://www.sitepoint.com/article/advanced-email-php/
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-14-2009, 08:26 AM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
You know what?
I hate life.
I was looking for an article JUST like that about a week ago when my E-mail was only working through my own computer (not remote ones)... I posted a question on here... and on sitepoint. and a billion people answered, none which accurately helped me.

Now, about a week later, on webmaster-talk I get a link to sitepoint's exact article!

!!!!!!!!!!!!!!!
*grits teeth*
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 08:29 AM Re: form textarea size adjustment
Skilled Talker

Posts: 68
Name: Avi Zolty
Location: Atlanta
Trades: 0
Thank you though.
Zoltar1992 is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 08:35 AM Re: form textarea size adjustment
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
Don't be hard on yourself av. You are obviously talented. No need to hate life. Anyway, you get what you give, right? If you hate life too much it'll hate you back.

I'm new to php generally, so I'm going to help you through your own eyes, so to speak...

first I found this - if i wanted to make a php script for mailing, I'm pretty sure this page is what i'd have to copy-paste code from
http://www.buildwebsite4u.com/advanced/php.shtml

you're probably already that far, but i had to catch up

now how do we get html mail? let's see...

oh yes. just call me doctor.
i found this
http://webcheatsheet.com/php/send_em...attachment.php

which leads to this
Code:
<?php
//define the receiver of the email
$to = 'youraddress@example.com';
//define the subject of the email
$subject = 'Test HTML email'; 
//create a boundary string. It must be unique 
//so we use the MD5 algorithm to generate a random hash
$random_hash = md5(date('r', time())); 
//define the headers we want passed. Note that they are separated with \r\n
$headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; 
//define the body of the message.
ob_start(); //Turn on output buffering
?>
--PHP-alt-<?php echo $random_hash; ?>  
Content-Type: text/plain; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit

Hello World!!! 
This is simple text email message. 

--PHP-alt-<?php echo $random_hash; ?>  
Content-Type: text/html; charset="iso-8859-1" 
Content-Transfer-Encoding: 7bit

<h2>Hello World!</h2>
<p>This is something with <b>HTML</b> formatting.</p> 

--PHP-alt-<?php echo $random_hash; ?>--
<?
//copy current buffer contents into $message variable and delete current output buffer
$message = ob_get_clean();
//send the email
$mail_sent = @mail( $to, $subject, $message, $headers );
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" 
echo $mail_sent ? "Mail sent" : "Mail failed";
?>
Give it a go, lad. You're definitely a have-a-go kinda guy. Don't let the world get you down. We're better than that - the ones who learn by ourselves.

Do tell me if it works. I'm not going to try it myself I don't reckon.
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 01-14-2009, 08:42 AM Re: form textarea size adjustment
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
I tried it. Easy enough - a simple copy-paste on the commandline and the page was made. One call to the url from my browser, the mail was sent. Opened my mailbox, there it was, in all its html glory. Definitely works, lad. Just use that. If you have any trouble tweaking it to fit your needs, just come and ask. I'll help you. It's about time I learned a bit of php.
witnesstheday is offline
Reply With Quote
View Public Profile
 
Old 01-15-2009, 03:12 PM Re: form textarea size adjustment
Banned

Posts: 923
Name: Geoff Vader
Location: In my dreams
Trades: 0
I didn't save Zoltar from his stress in time! He was captured by his stress 6 minutes before I provided the antidote. I wonder if he figured it out yet. That could be it. Maybe he didn't get captured by his stress... maybe he beat it.
witnesstheday is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to form textarea size adjustment

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.91902 seconds with 12 queries