I recently took over a perl project and am not familiar with Perl. Any help would be appreciated?
I need to ask a question for confirmation ( whether they chose to delete data or not ) when clicking on a button. My understanding is that you can not achieve this with Perl. How do I allow a popup asking a question for confirmation.
Here is my code:
<%= $delete_all_skills->input( -form=>$form, -label=>'cancel', -value
+=>"Delete All Skills", -javascript=>$question_javascript ) %>
my $question_javascript = 'onclick="askdata()"';
<SCRIPT LANGUAGE="JavaScript">
function askData() {
doyou = confirm("Are you sure you want to delete ALL the skills? (OK =
+ Yes Cancel = No)"); //Your question.
if (doyou == true)
alert("All your skills have been deleted"); //If your question is answ
+ered Yes.
else
if (doyou == false)
alert("Your skills have not been deleted"); //If your question is answ
+ered No.
</SCRIPT>
return( askdata );
}
edited: Wed May 14 17:10:29
by jeffa - title change (was: asking questions)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.