I encourage you to start with a working example and build from there. There are several examples in the Form Example in Examples project (<a href="http://drupal.org/project/examples">http://drupal.org/project/examples</a>), and there are examples throughout core that you can look at. <br>
<br>In addition, focus on learning how to debug so you can solve these yourself. <a href="http://randyfay.com/debugging_drupal">http://randyfay.com/debugging_drupal</a> may be useful to you, and the Devel module with its dsm() function is widely used by people to figure out what&#39;s going on in situations like this.<br>
<br>This is a very helpful group, but they won&#39;t (usually) help you debug your code or learn the basics of Drupal development.<br><br>-Randy<br><br><div class="gmail_quote">On Sat, Jan 8, 2011 at 5:42 AM, mahesh gajabar <span dir="ltr">&lt;<a href="mailto:mahesh143an@gmail.com">mahesh143an@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="color: rgb(34, 34, 34); font-family: &#39;Lucida Grande&#39;,&#39;DejaVu Sans&#39;,&#39;Bitstream Vera Sans&#39;,Verdana,Arial,sans-serif; font-size: 13px; line-height: 18px;"><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

Hi <br></p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">I have wrote custom module for showing values in html format table. I have delete and edit action for every row. My delete function working but edit function not working .Whats wrong with code. What i need to do corrections for it.For editing the form i NEED TO BE get default values in form that too not getting.please help me guys</p>

<blockquote style="border-width: 0px; background-color: rgb(255, 255, 255); font-size: 13px; margin: 1.384em 40px 1.384em 20px; padding: 0px 0px 0px 30px; vertical-align: baseline; quotes: none;">
<p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;"><b style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px; padding: 0px; vertical-align: baseline;"><br>

&lt;?php</b></p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">function doctor_menu() {<br>$items = array();</p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

$items[&#39;doctor&#39;] = array(<br>&#39;title&#39; =&gt; t(&#39;Doctors&#39;),<br>&#39;page callback&#39; =&gt; &#39;doctors_list&#39;,<br>&#39;access arguments&#39; =&gt; array(&#39;access doctor&#39;),<br>&#39;type&#39; =&gt; MENU_NORMAL_ITEM );<br>

$items[&#39;doctor/delete/%doctor_user&#39;] = array(<br>&#39;title&#39; =&gt; t(&#39;Delete doctor&#39;),<br>&#39;page callback&#39; =&gt; &#39;drupal_get_form&#39;,<br>&#39;page arguments&#39; =&gt; array(&#39;doctor_delete_confirm&#39;, 2),<br>

&#39;access arguments&#39; =&gt; array(&#39;access doctor&#39;),<br>&#39;type&#39; =&gt; MENU_CALLBACK, );<br>$items[&#39;doctor/edit/%doctor_user&#39;] = array(<br>&#39;title&#39; =&gt; t(&#39;Edit Form&#39;),<br>&#39;page callback&#39; =&gt; &#39;drupal_get_form&#39;,<br>

&#39;page arguments&#39; =&gt; array(&#39;doctor_edit_confirm&#39;, 2),<br>&#39;access arguments&#39; =&gt; array(&#39;access doctor&#39;),<br>&#39;type&#39; =&gt; MENU_NORMAL_ITEM,<br>);return $items;<br>}<br>function doctors_list() {<br>

$header = array(t(&#39;Doctor Name&#39;), t(&#39;Gender&#39;), t(&#39;Status&#39;), t(&#39;Action&#39;));<br>$query = &quot;SELECT * FROM {doctor}&quot;;<br>$rs = db_query($query);<br>$row = array();<br>if ($rs) {<br>while ($data = db_fetch_object($rs)) {<br>

$gender = $data-&gt;gender;<br>$status = $data-&gt;status ;<br>$row[] = array(stripslashes(ucwords($data-&gt;firstname)) . &#39; &#39; . stripslashes(ucwords($data-&gt;lastname)), $gender, $status,<br>&quot;<a style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(6, 120, 190); text-decoration: none;">doctorid}&#39;&gt;&quot; . t(&#39;Edit&#39;) . &quot;</a><span> </span>|<span> </span><a style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(6, 120, 190); text-decoration: none;">doctorid}&#39;&gt;&quot; . t(&#39;Delete&#39;) . &quot;</a>&quot;);<br>

}}<br>$str .= theme_table($header, $row);<br>return $str;<br>}<br>function doctor_user_load($doctorid) {<br>$query = &quot;SELECT * FROM {doctor} WHERE doctorid = %d&quot;;<br>$rs = db_query($query, $doctorid);</p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

if ($rs) {<br>while ($data = db_fetch_object($rs)) {<br>return $data;<br>}}<br>return FALSE;<br>}<br>function doctor_delete_confirm(&amp;$form_state, $doctor) {<br>$form[&#39;_doctor&#39;] = array(<br>&#39;#type&#39; =&gt; &#39;value&#39;,<br>

&#39;#value&#39; =&gt; $doctor,);</p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">return confirm_form($form,t(&#39;Are you sure you want to delete this doctor?&#39;),<br>

isset($_GET[&#39;destination&#39;]) ? $_GET[&#39;destination&#39;] : &quot;doctor&quot;,t(&#39;This action cannot be undone.&#39;),t(&#39;Delete&#39;),t(&#39;Cancel&#39;));}</p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

function doctor_delete_confirm_submit($form, &amp;$form_state) {<br>$form_values = $form_state[&#39;values&#39;];<br>if ($form_state[&#39;values&#39;][&#39;confirm&#39;]) {<br>$doctor = $form_state[&#39;values&#39;][&#39;_doctor&#39;];</p>

<p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">$query = &quot;DELETE FROM {doctor} where doctorid=$doctor&gt;doctorid&quot;;<br>

$rs = db_query($query);<br>drupal_set_message(t(&#39;Doctor has been deleted successfully.&#39;));}<br>drupal_goto(&quot;doctor&quot;);<br>}<br>function doctor_edit_confirm(&amp;$form_state,$doctor){</p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

$form = array();<br>$form[&#39;firstname&#39;]=array(<br>&#39;#title&#39;=&gt;t(&#39;First Name&#39;),<br>&#39;#type&#39;=&gt;&#39;textfield&#39;,<br>&#39;#default_value&#39; =&gt; $firstname );<br>$form[&#39;lastname&#39;]=array(<br>

&#39;#title&#39;=&gt;t(&#39;Last Name&#39;),<br>&#39;#type&#39;=&gt;&#39;textfield&#39;,<br>&#39;#default_value&#39; =&gt; $lastname);<br>$form[&#39;gender&#39;]=array(<br>&#39;#title&#39;=&gt;t(&#39;Gender&#39;),<br>&#39;#type&#39;=&gt;&#39;radios&#39;,&#39;#options&#39; =&gt; array(t(&#39;male&#39;), t(&#39;female&#39;)),<br>

&#39;#default_value&#39; =&gt; male);<br>$form[&#39;status&#39;]=array(<br>&#39;#title&#39;=&gt;t(&#39;Status&#39;),<br>&#39;#type&#39;=&gt;&#39;radios&#39;,<br>&#39;#default_value&#39; =&gt; active,<br>&#39;#options&#39; =&gt; array(t(&#39;active&#39;), t(&#39;inactive&#39;)));<br>

return confirm_form($form,t(&#39;&#39;),<br>isset($_GET[&#39;destination&#39;]) ? $_GET[&#39;destination&#39;] : &quot;doctor&quot;,<br>t(&#39;&#39;),<br>t(&#39;Edit&#39;),<br>t(&#39;Cancel&#39;));}</p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

function doctor_edit_confirm_submit($form, &amp;$form_state)<br>{<br>$form_values = $form_state[&#39;values&#39;];<br>if ($form_state[&#39;values&#39;][&#39;confirm&#39;]) {<br>$doctor = $form_state[&#39;values&#39;][&#39;_doctors&#39;];<br>

$query = &quot;UPDATE {doctor} WHERE doctorid=&#39;$doctor-&gt;doctorid&#39;&quot;;<br>} drupal_goto(&quot;doctor&quot;);}</p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

<span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; font-size: medium;"><span style="font-family: arial; font-size: small;"><b><i style="color: rgb(0, 153, 0); font-family: &#39;comic sans ms&#39;,sans-serif;"><font style="color: rgb(0, 153, 0);" size="2">MAHESH GAJABAR</font></i><br style="color: rgb(0, 153, 0); font-family: &#39;comic sans ms&#39;,sans-serif;">

<font style="color: rgb(0, 153, 0); font-family: &#39;comic sans ms&#39;,sans-serif;" size="2"><i>Software Developer<br>FrontalRain Technologies,Bengaluru</i></font></b><br></span></span></p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;">

<br></p><p style="border-width: 0px; background-color: transparent; font-size: 13px; margin: 0px 0px 0.692em; padding: 0px; vertical-align: baseline;"><br></p></blockquote></span></span>
</blockquote></div><br><br clear="all"><br>-- <br>Randy Fay<br>Drupal Module and Site Development<br><a href="mailto:randy@randyfay.com">randy@randyfay.com</a><br>+1  970.462.7450<br><br>