This topic is locked

Confirmation box on clicking print selected

4/12/2008 2:59:55 AM
PHPRunner General questions
kujox author

I want to have a confirmation box pop up when the print selected link is clicked, just like one comes up when delete selected is clicked.
I have looked and the link already has a lot of script in it and I don't know enough javascript to know how to add the on click confirm code.
Does anyone have any idea on the code to do this

J
Jane 4/14/2008

Hi,
here is a sample:

{literal}<INPUT class=button onclick="var c=0;if(frmAdmin.elements['selection[]'].length==undefined &amp;&amp; frmAdmin.elements['selection[]'].checked) c=1; else for (i=0;i<frmAdmin.elements['selection[]'].length;++i) if (frmAdmin.elements['selection[]'][i].checked) c=1; if(c==0) return true; if (confirm('Do you really want to print these records?')) {frmAdmin.action='categories_print.php';frmAdmin.target='_blank';frmAdmin.submit(); frmAdmin.action='categories_list.php'; frmAdmin.target='_self';}" type=button value="Print selected" disptype="control1">

{/literal}

kujox author 4/15/2008

Hi,

here is a sample:


Thanks Jane that works well, is there a way to make it used in a link and not an input button, do I just swap the input tags for a href?

J
Jane 4/15/2008

Yes. Just replace INPUT tag with A tag.