fred1010 has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: OT: values not working.
by eibwen (Friar) on Aug 02, 2005 at 11:19 UTC

    From the context of your post and this being your first writeup (as per your homenode), I presume (perhaps falsely):

    • You didn't write the code (a perl file containing some HTML, likely a CGI), but now have to maintain it
    • You don't yet understand perl and/or HTML

    With regard to the latter, check out the HTML 4.01 Specification (particularly note your misuse of form inputs). As to the perl... it would help if you actually posted the perl code as opposed to the HTML, however:

    Your first question is purely HTML in nature. The problem is that the value itself is a mere string -- I believe you're looking for:

    <font size=4><input type=radio value="HTML is not Perl"></font>

    Ultimately you may have to use CSS for that purpose as the rendering of forum widgets (even the text of the values) is largely left to the individual browser. If you have any further questions regarding HTML or CSS, consult the specifications.

    With regard to the latter question, you appear to be using a bit of Perl -- but with the wrong HTML. To title an HTML document with $title merely include the title tag in the head, eg:

    <html> <head> <title>$title</tile> </head> <body> This is sparse CGI Output </body> </html>

    Hopefully that should get you started. If you still need help, please post the actual code -- at least the pertinant sections.

    UPDATE: After re-reading your post it's aparent that you used the term 'title' to reference a particular "feature" of your site as opposed to the actual HTML tag. Nevertheless, the problem appears to be a malfunctioning Perl CGI -- please post the relevant code.

Re: OT: values not working.
by rvosa (Curate) on Aug 02, 2005 at 12:01 UTC
    Some general (but somewhat off-topic) suggestions:
    • Make your HTML tags all lower case. It's not strictly necessary for HTML4.01 but it is for XHTML, so it's a good way of preparing for the better days that lie ahead.
    • Quote all attribute values.
    This would turn:
    <INPUT NAME=TITLE VALUE=\"$title\" TYPE=TEXT SIZE=55 MAXLENGTH=55>
    into:
    <input name=\"TITLE\" value=\"$title\" type=\"TEXT\" size=\"55\" maxle +ngth=\"55\">
    (Yes, and there are ways to avoid all those slashes...)

    Okay, so, w.r.t. Problem #1, it's hard to tell whether the code you are having difficulty with is generated by the perl program or hand crafted. If the latter, setting a font size to 4 could be done <font size="4">like this</font>, but I would recommend you avoid the font of foulness. If you are having difficulty making the perl script spit out the code you're looking for (i.e. the other option), we won't be able to give any hints without looking at the perl code - which is, well, kind of the point of perlmonks.

    Problem #2: the input field in your first half of the code has VALUE=\"$title\". If you want that same string contained by $title to show up in your textarea in the second half of the code, just use the $title variable instead of the $desc variable:
    <textarea name=\"DESC\" rows=\"5\" cols=\"55\" wrap=\"physical\"> $tit +le </textarea>
    ...but I'm not entirely sure if that's what you're looking for.

    Lastly, I have to agree with the other replies you've received - your query is more to do with HTML than with perl, and frankly that's not what this site is for. Good luck anyway.
Re: OT: values not working.
by BurnOut (Beadle) on Aug 02, 2005 at 22:30 UTC

    Problem 1: Have you tried changing the input type to something like "hidden" or "checkbox"? That would get rid of the radio button. If you want to change it to hidden, remember to get rid of the "selected" and if you change it to checkbox, change "selected" to "checked".

    Just a side note. You may be able trick the program into allowing you play around with the font sizes you can choose. If this is the case, you may be able to use a drop down list instead:

    <select name="DESCSIZE"> <option value="<font size=3>">3</option> <option value="<font size=4>" selected>4</option> </select>

    Problem #2: Change $title to $desc. Or $title - $desc if you want both the title and the code. Unfortunately, I have the inkling that the author of this code may insert your font tag from problem one into the title. Try it and see.

    Problem #3: This program makes me nervous. There's something hinky going on here. Whoever wrote this program may be rolling their own templating system (see A quick and dirty template system for more info). It's also trusting user input (by taking the HTML element font verbatim from the user and most likely inserting directly into the html using the homegrown template system which is a security hole. I'm not sure if they're validating the input, but I doubt it.

    I sure hope you didn't pay a lot for this program. I haven't seen the code, but I have a funny feeling that it's full of security holes. And those holes may cost you money.

Re: OT: values not working.
by bradcathey (Prior) on Aug 02, 2005 at 13:19 UTC

    Yup, you're at the wrong place. But I hope you learn a bunch and find out you need the magic of Perl, are ready to learn CGI, and come back.

    In the meantime, check out this compact basic course (you can even download it). Good luck.


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot
Re: OT: values not working.
by blazar (Canon) on Aug 02, 2005 at 10:25 UTC
    And your Perl question is?

    Hint: 'Perl' !~ any (HTML | Web | CGI | Apache) (hope I got this right, I'm eager to see this corrected.)

      I'm pretty sure you just want:  'Perl' ne (HTML | Web | CGI | Apache)
Re: OT: values not working.
by true (Pilgrim) on Aug 02, 2005 at 16:32 UTC
    Your question is very hard to follow. I think the second part you are actually asking about javascript but i am not sure. Something like when a user enters a text description for a title in your form, another html form field is automatically filled? Or are you asking how to do this on the backend inside the perl cgi? Both ways will work but each require a different solution.

    The first part i think maybe the value is being set correctly but you can't see it because you are outputing the result and viewing via html which means the value"<font size=4>" is not viewable unless you view source code?

    Please note that html questions do occasionally get answered here if they are clearly written. Spend a little more time on your question. Make sure it is very easy to follow. I have asked questions here before which take hours to compose. It's the only way i can be sure and get a good answer.

    Good luck

    jtrue
A reply falls below the community's threshold of quality. You may see it by logging in.