FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 03-07-1999, 04:49 PM   Postid: 15882
Benson
Site Owner

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: NC, USA
Posts: 478
simple script question

I'm customizing a mailing list perl script for quicker usage..

In the following, how can I put default values in the script? I want to make some radio buttons checked by default and put some text in the text boxes..

[quote]
print "Subject: <input type=\"text\" name=\"subject\" size=40>

\n";
print "Use salutation?
\n";
print "<input type=\"radio\" name=\"usename\" value=\"yes\">Yes\n";
print "<input type=\"radio\" name=\"usename\" value=\"no\">No

\n";

print "Of the form:
\n";
print "<input type=\"text\" name=\"beforename\" size=20>\n";
print "NAME\n";
print "<input type=\"text\" name=\"aftername\" size=20>

\n";
[\quote]

------------------
ICQ#8418658-alba gu brath!



Benson is offline   Reply With Quote
Old 03-07-1999, 04:59 PM   Postid: 15883
 Deb
FutureQuest, Inc.
 
Deb's Avatar
 
Join Date: Jun 1998
Location: Franktown Colorado
Posts: 6,781
For type=Text areas add Value="Whatever You Want"
This will make the Value= the dafault

To have a radio button checked
type=radio CHECKED name="....



Deb
Deb is offline   Reply With Quote
Old 03-07-1999, 05:32 PM   Postid: 15884
Benson
Site Owner

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: NC, USA
Posts: 478
Thanks Deb, works great - though it took me a couple of minutes to realize that some "\" were needed to precede the quotation marks in the value fields..

cheers

Benson is offline   Reply With Quote
Old 03-08-1999, 08:54 PM   Postid: 15885
ChrisH
Site Owner

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Jan 1999
Location: Long Island, New York
Posts: 75

You can use qq in perl to avoid all
this quoting, too. For example,

print "value=\"true\"";

print qq!value="true"!;

print qq/value="true"/;

are all the same. The qq uses the
next character instead of the "
character. Handy for cases like this.

ch
ChrisH is offline   Reply With Quote
Old 03-08-1999, 09:28 PM   Postid: 15886
Benson
Site Owner

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: NC, USA
Posts: 478
aha..ok thanks. Perl and I aren't on a first name basis, exactly!
Benson is offline   Reply With Quote
Old 03-08-1999, 09:34 PM   Postid: 15887
Justin
Visitor
 
Justin's Avatar

Forum Notability:
0 pts:
[Post Feedback]
 
Join Date: Jan 1999
Location: Kissimmee, FL
Posts: 3,672
A side note about HTML - you don't have to quote all of the values. The general rule is if there is white space in a value, quote it, otherwise you don't have to.

print "Subject: <input type=text name=subject size=40>

\n";
print "<input type=radio name=username value=yes>Yes\n";

And so on. I only qupte URL's or whitespace, and all browsers I've used accept it just fine. And if I'm not mistaken, the browser can actually render numbers (even colors) quicker when not quoted, because they must be converted from a literal string into a value - but that's a whole different issue

Also, you can do this:

print <<End;
Subject: <input type=text name=subject size=40>
blah blah blah
"blah"
etc
End

That will work and eliminate having to escape quotes, type new lines, and semicolons. Also makes for nicer formatting in your code, too


------------------
Justin Nelson, SFE Software
www.vdj.net
Justin is offline   Reply With Quote
Old 03-08-1999, 09:55 PM   Postid: 15888
 Terra
CTO FutureQuest, Inc.
 
Terra's Avatar
 
Join Date: Jun 1998
Location: Z'ha'dum
Posts: 7,683
I agree with Justin, HERE docs rock!

Nothing worse than having carefully crafted Perl code, mucked up by all that gui (gooey) html stuff...

Deb, keep yer mits off my code!

--
Terra
--Deb, it's a $16.00 fine for dipping your hands in the cookie jar--
FutureQuest
Terra is offline   Reply With Quote
Old 03-08-1999, 10:05 PM   Postid: 15889
 Deb
FutureQuest, Inc.
 
Deb's Avatar
 
Join Date: Jun 1998
Location: Franktown Colorado
Posts: 6,781
Thanks a lot JUSTIN! Now ya got me in trouble

Deb is offline   Reply With Quote
Old 03-09-1999, 01:52 AM   Postid: 15890
Benson
Site Owner

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: NC, USA
Posts: 478
[ucode]print <<End;
Subject: <input type=text name=subject size=40>
blah blah blah
"blah"
etc
End[/quote]

This works well 8)

[This message has been edited by Benson (edited 03-09-99).]
Benson is offline   Reply With Quote
Old 03-09-1999, 01:54 AM   Postid: 15891
Benson
Site Owner

Forum Notability:
10 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: NC, USA
Posts: 478
Something doesn't look quite right ^^



------------------
I'd rather have a bottle in front
of me than a frontal lobotomy
Benson is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:06 PM.


Running on vBulletin®
Copyright © 2000 - 2013, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2013 FutureQuest, Inc.
FutureQuest, Inc.