?
Solved

onclick event

Posted on 2007-10-10
3
Medium Priority
?
241 Views
Last Modified: 2013-12-13
Hello,
here is a delete button I need to put this onclick event inside the delete
<TD colspan=\"0\" class=\"bouton\" ><INPUT name='delete' type=\"submit\" value=\"".BTN_DELETE."\" class=\"btn\" ></TD>

*****

onclick=\"getOpaque(true); var id = window.showModalDialog('/identification/form.php?action=password', '', 'dialogHeight: 150px; dialogWidth: 200px; center: yes; help: no; resizable: no; scroll: no; status: no;'); getOpaque(false); if (id) { document.getElementById('idUser').value = id; document.getElementById('submitbtn').click(); }
0
Comment
Question by:usmbay
  • 2
3 Comments
 
LVL 18

Expert Comment

by:Antonio Estrada
ID: 20050371
If I understand correctly, try this:

<head>
<script language="JavaScript">
<!--
function doActions() {
getOpaque(true); var id = window.showModalDialog('/identification/form.php?action=password', '', 'dialogHeight: 150px; dialogWidth: 200px; center: yes; help: no; resizable: no; scroll: no; status: no;'); getOpaque(false); if (id) { document.getElementById('idUser').value = id; document.getElementById('submitbtn').click();
document.forms["YOURFORMNAMEHERE"].submit();
}
//-->
</script>
</head>

<TD colspan=\"0\" class=\"bouton\" ><INPUT name='delete' type=\"button\" value=\"".BTN_DELETE."\" class=\"btn\" onClick="doActions();" /></TD>

HTH

-V
0
 
LVL 54

Accepted Solution

by:
b0lsc0tt earned 2000 total points
ID: 20050396
You should just need ...

<TD colspan=\"0\" class=\"bouton\" ><INPUT name='delete' type=\"submit\" value=\"".BTN_DELETE."\" class=\"btn\" onclick=\"getOpaque(true); var id = window.showModalDialog('/identification/form.php?action=password', '', 'dialogHeight: 150px; dialogWidth: 200px; center: yes; help: no; resizable: no; scroll: no; status: no;'); getOpaque(false); if (id) { document.getElementById('idUser').value = id; document.getElementById('submitbtn').click(); }\"></TD>

The onclick you had looked good.  I added the closing double quote for the onclick event in the element.  If that doesn't work then look at the browser's html source and look for a Javascript error.  Post that info here.

Let me know if you have a question.

bol
0
 
LVL 54

Expert Comment

by:b0lsc0tt
ID: 20050608
I'm glad I could help.  Thanks for the grade, the points and the fun question.

bol
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month16 days, 3 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question