<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV></DIV>
<DIV>Well, I will be the lone wolf here I guess. The "standard Drupal" way is to use the delete_confirm dialog API, which you can find documented in&nbsp;<A href="http://api.drupal.org">http://api.drupal.org</A>.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Have you even tried a search on drupal.org? I am certain that you would find your answers there.<BR>&nbsp;</DIV>
<P><FONT color=#ff007f size=4 face="bookman old style, new york, times, serif"><EM><STRONG>Nancy</STRONG></EM></FONT></P>
<P><FONT face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</FONT></P>
<DIV><BR></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> mahesh gajabar &lt;mahesh143an@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> development@drupal.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Wed, January 12, 2011 1:37:59 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [development] creating pop-up window for delete and edit actions in table in module file<BR></FONT><BR>Hi,<BR>
<DIV class=gmail_quote>I have written a custome module table for showing some information which is fetched from database and every row is having edit and delete actions. Both are working fine. But whenever I click on on edit or delete action action it opens in other window leaving current page. I want these actions to be taken place in pop-up window. <BR><BR>My table on drupal screen is as follows<BR><BR>
<TABLE border=0 cellPadding=0>
<THEAD>
<TR>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="TEXT-ALIGN: center; LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal align=center><B><SPAN style="FONT-SIZE: 12pt">SlNo</SPAN></B></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="TEXT-ALIGN: center; LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal align=center><B><SPAN style="FONT-SIZE: 12pt">Doctor Name</SPAN></B></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="TEXT-ALIGN: center; LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal align=center><B><SPAN style="FONT-SIZE: 12pt">Gender</SPAN></B></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="TEXT-ALIGN: center; LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal align=center><B><SPAN style="FONT-SIZE: 12pt">Status</SPAN></B></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="TEXT-ALIGN: center; LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal align=center><B><SPAN style="FONT-SIZE: 12pt">Action</SPAN></B></P></TD></TR></THEAD>
<TBODY>
<TR>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">2</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">Jayaram Srinivasan</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">male</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">inactive</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt"><A href="http://localhost/fr/doctor/edit/2" rel=nofollow target=_blank><SPAN style="COLOR: blue">Edit</SPAN></A> |<A href="http://localhost/fr/doctor/delete/2" rel=nofollow target=_blank><SPAN style="COLOR: blue"> Delete</SPAN></A></SPAN></P></TD></TR>
<TR>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">3</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">Pavithra M</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">female</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">active</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt"><A href="http://localhost/fr/doctor/edit/3" rel=nofollow target=_blank><SPAN style="COLOR: blue">Edit</SPAN></A> |<A href="http://localhost/fr/doctor/delete/3" rel=nofollow target=_blank><SPAN style="COLOR: blue"> Delete</SPAN></A></SPAN></P></TD></TR>
<TR>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">4</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">Ravi Mandayam</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">male</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt">active</SPAN></P></TD>
<TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt">
<P style="LINE-HEIGHT: normal; MARGIN-BOTTOM: 0pt" class=MsoNormal><SPAN style="FONT-SIZE: 12pt"><A href="http://localhost/fr/doctor/edit/4" rel=nofollow target=_blank><SPAN style="COLOR: blue">Edit</SPAN></A> |<A href="http://localhost/fr/doctor/delete/4" rel=nofollow target=_blank><SPAN style="COLOR: blue"> Delete</SPAN></A></SPAN></P></TD></TR></TBODY></TABLE><BR>when i click delete button i should get pop-up window with the dialogue like this;<BR><BR>
<H2>Are You Sure You Want To Delete This Doctor?</H2>This action cannot be undone.<INPUT value=1 type=hidden name=confirm> 
<DIV><INPUT value=Delete type=submit name=op> <A href="http://localhost/fr/doctor" rel=nofollow target=_blank>Cancel</A><BR><BR>When I click edit button I should get my edit form,<BR><SPAN>
<DIV></DIV></SPAN>
<DIV><LABEL>First Name: </LABEL><INPUT value=jayaram maxLength=128 size=60 name=firstname> </DIV>
<DIV><LABEL>Last Name: </LABEL><INPUT value=srinivasan maxLength=128 size=60 name=lastname> </DIV>
<DIV><LABEL>Gender: </LABEL>
<DIV>
<DIV><LABEL><INPUT value=0 CHECKED type=radio name=gender> male</LABEL> </DIV>
<DIV><LABEL><INPUT value=1 type=radio name=gender> female</LABEL> </DIV></DIV></DIV>
<DIV><LABEL>Status: </LABEL>
<DIV>
<DIV><LABEL><INPUT value=0 type=radio name=status> active</LABEL> </DIV>
<DIV><LABEL><INPUT value=1 CHECKED type=radio name=status> inactive</LABEL> </DIV></DIV></DIV><INPUT value=1 type=hidden name=confirm> 
<DIV><INPUT value=Save type=submit name=op> <A href="http://localhost/fr/doctor" rel=nofollow target=_blank>Cancel</A></DIV>&nbsp;<BR>complete code of my module file is as follows:<BR><BR><I style="FONT-FAMILY: verdana, sans-serif"><B>&lt;?php<BR><BR>function doctor_menu() {<BR>&nbsp; $items = array();<BR>&nbsp;<BR>&nbsp; $items['doctor'] = array(<BR>&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Doctors'),<BR>&nbsp;&nbsp;&nbsp; 'page callback' =&gt;'doctors_list',<BR>&nbsp;&nbsp;&nbsp; 'access arguments' =&gt; array('access doctor'),<BR>&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_NORMAL_ITEM,<BR>&nbsp; );<BR>&nbsp;<BR>&nbsp; $items['doctor/delete/%doctor_user'] = array(<BR>&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Delete doctor'),<BR>&nbsp;&nbsp;&nbsp; 'page callback' =&gt; 'drupal_get_form',<BR>&nbsp;&nbsp;&nbsp; 'page arguments' =&gt; array('doctor_delete_confirm', 2),<BR>&nbsp;&nbsp;&nbsp; 'access arguments' =&gt; array('access doctor'),<BR>&nbsp;&nbsp;&nbsp; 'type' =&gt;
 MENU_CALLBACK,<BR>&nbsp; );<BR>&nbsp;$items['doctor/edit/%doctor_user'] = array(<BR>&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Edit Form'),<BR>&nbsp;&nbsp;&nbsp; 'page callback' =&gt; 'drupal_get_form',<BR>'page arguments' =&gt; array('doctor_edit_confirm', 2),<BR>&nbsp;&nbsp; 'access arguments' =&gt; array('access doctor'),<BR>&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_NORMAL_ITEM,<BR>&nbsp; );<BR>&nbsp; return $items;<BR>}<BR><BR>function doctors_list() {<BR>&nbsp;&nbsp;&nbsp; $header = array(t(Sl.No),t('Doctor Name'), t('Gender'),&nbsp; t('Status'), t('Action'));<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; $query = "SELECT * FROM {doctor}";<BR>&nbsp;&nbsp;&nbsp; $rs = db_query($query);<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; $row = array();<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; if ($rs) {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while ($data = db_fetch_object($rs))
 {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $doctorid = $data-&gt;doctorid;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $gender = $data-&gt;gender;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $status = $data-&gt;status ;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $row[] = array($doctorid,stripslashes(ucwords($data-&gt;firstname)) . ' ' . stripslashes(ucwords($data-&gt;lastname)), $gender, $status, <BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "&lt;a href='doctor/edit/{$data-&gt;doctorid}'&gt;" . t('Edit') .&nbsp; "&lt;/a&gt; |&lt;a href='doctor/delete/{$data-&gt;doctorid}'&gt; ". t('Delete')."&lt;/a&gt;"
 );<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; $str .= theme_table($header, $row);<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; return $str;<BR>}<BR>function doctor_user_load($doctorid) {<BR>&nbsp;&nbsp;&nbsp; $query = "SELECT * FROM {doctor} WHERE doctorid = %d";<BR>&nbsp;&nbsp;&nbsp; $rs = db_query($query, $doctorid);<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; if ($rs) {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while ($data = db_fetch_object($rs)) {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return $data;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; return FALSE;<BR>}<BR><BR>function popup()<BR>{<BR>window.confirm();<BR>return false;<BR>}<BR><BR>function doctor_delete_confirm(&amp;$form_state, $doctor) {<BR>&nbsp;&nbsp;&nbsp; $form['_doctor'] = array(<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#type' =&gt; 'value',<BR>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; '#value' =&gt; $doctor,<BR>&nbsp;&nbsp;&nbsp; );<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; return confirm_form($form,<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t('Are you sure you want to delete this doctor?'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; isset($_GET['destination']) ? $_GET['destination'] : "doctor",<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t('This action cannot be undone.'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t('Delete'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t('Cancel'));<BR>}<BR><BR>function doctor_delete_confirm_submit($form, &amp;$form_state) {<BR>&nbsp;&nbsp;&nbsp; $form_values = $form_state['values'];<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; if ($form_state['values']['confirm']) {<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $doctor =
 $form_state['values']['_doctor'];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $query = "DELETE&nbsp; FROM {doctor} where doctorid= $doctor-&gt;doctorid";<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rs = db_query($query);<BR>drupal_set_message(t('Doctor has been deleted successfully.'));<BR>&nbsp; &nbsp;&nbsp;&nbsp; }&nbsp; drupal_goto("doctor");<BR>}<BR><BR>function doctor_edit_confirm(&amp;$form_state,$doctor){<BR>&nbsp;$form = array();<BR>$form['_doctors'] =
 array(<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#type' =&gt; 'value',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#value' =&gt; $doctor,<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; );<BR><BR>$query = "SELECT * FROM {doctor} where doctorid=%d";<BR>&nbsp;&nbsp;&nbsp; $rs = db_query($query,$doctor-&gt;doctorid);<BR>$data=db_fetch_object($rs);<BR>$firstname=$data-&gt;firstname;<BR>$lastname=$data-&gt;lastname;<BR>$gender1 = $data-&gt;gender;<BR>$gender = $gender1 ? 0: 1;<BR>$status1 = $data-&gt;status ;<BR>$status = $status1 ? 1: 0;<BR>$form['firstname']=array(<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#title'=&gt;t('First Name'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 '#type'=&gt;'textfield',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#default_value'=&gt;$data-&gt;firstname,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp; );<BR>$form['lastname']=array(<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#title'=&gt;t('Last Name'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#type'=&gt;'textfield',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#default_value' =&gt; $lastname,<BR>&nbsp;&nbsp;&nbsp;
 );<BR>$form['gender']=array(<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#title'=&gt;t('Gender'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#type'=&gt;'radios',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#options' =&gt; array(t('male'), t('female')),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#default_value' =&gt; variable_get('gender',$gender),<BR>&nbsp;&nbsp;&nbsp;
 );<BR>$form['status']=array(<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#title'=&gt;t('Status'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; '#type'=&gt;'radios',<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#options' =&gt; array(t('active'), t('inactive')),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#default_value' =&gt; variable_get('status',$status),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; );<BR>&nbsp;&nbsp;&nbsp; <BR>return
 confirm_form($form,t(''),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; isset($_GET['destination']) ? $_GET['destination'] : "doctor",<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t(''),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t('Save'),<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; t('Cancel'));<BR>}<BR><BR>function doctor_edit_confirm_submit($form, &amp;$form_state)<BR>{<BR>if ($form_state['values']['confirm']) {<BR>$doctor = $form_state['values']['_doctors'];<BR>$form_state['values']['doctorid'] = $doctor-&gt;doctorid;<BR>&nbsp;$firstname = $form_state['values']['firstname'];<BR>&nbsp;&nbsp;&nbsp; $lastname = $form_state['values']['lastname'];<BR>&nbsp;&nbsp;&nbsp; $gender1= $form_state['values']['gender'];<BR>$gender =&nbsp; $gender1 ? t('female') : t('male');<BR>&nbsp;&nbsp;&nbsp; $status1 = $form_state['values']['status'];<BR>$status = $status1 ? t('inactive') : t('active');<BR>$query = "UPDATE&nbsp; {doctor} SET firstname = '$firstname', lastname=
 '$lastname',&nbsp; gender = '$gender', status = '$status'&nbsp; WHERE&nbsp; doctorid=%d";<BR>&nbsp;$rs = db_query($query,$doctor-&gt;doctorid); }<BR>drupal_goto("doctor");<BR>}<BR><BR></B></I><SPAN style="FONT-FAMILY: verdana, sans-serif">Any help appreciated.</SPAN><I style="FONT-FAMILY: verdana, sans-serif"><B><BR><BR></B></I></DIV><I style="FONT-FAMILY: verdana, sans-serif"><B>Regards,</B></I><BR><FONT color=#888888>Mahesh Gajabar<BR></FONT></DIV><BR></DIV></DIV></div></body></html>