Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
form submission does not work!
Old 06-11-2007, 03:24 PM form submission does not work!
Average Talker

Posts: 22
Trades: 0
hi..
i'm using js to submit the form that i have,
my php code is
Code:
for($i=0; $i<$period; $i++)
                         {
                              print "<form name= \"bookAppointment$i\" id= \"bookAppointment\" action= \"../action/bookAppointment.php\" method= \"GET\">";
                              print "<tr>";      
                              print "<td class= \"textCenter\">";
                              print $time;
                              print "</td>";
                              $query_view_appointment= "select a.appId, a.timeFrom, s.sname, p.pname, ata.appTypeName, asa.appStatName";
                              $query_view_appointment2 =" where a.staffId='$staffId' and a.staffId=s.staffId and a.date= '$date' and a.timeFrom ='$time' and a.patientId=p.patientId and a.appStatId=asa.appStatId and a.appTypeId=ata.appTypeId";
                              $query_view_appointment.= $query_view_appointment1.$query_view_appointment2;
                               $result= safe_query($query_view_appointment);
                     
                              while (list($appId, $timeFrom, $sname, $pname, $appTypeName, $appStatName)= mysql_fetch_array($result))
                              {
                                  
                                  print "<td class= \"textCenter\">";
                                ?>
                                    <a href= "staff.php?staffId=<?php echo $sname?>"><?php echo $sname ?></a>
                                <?php
                                  print "</td>";
                                  print "<td class= \"textCenter\">";
                                ?>
                                        <a href= "patient.php?patientId=<?php echo $patientId?>"><?php echo $pname ?></a>
                                <?php
                                  print "</td>";
                                  print "<td class= \"textCenter\">";
                                  print $appTypeName;
                                  print "</td>";
                                  print "<td class= \"textCenter\">";
                                  print "<select name= \"appStatName\" class= \"textBox\">";
                                  $result_app_stat = safe_query("SELECT appStatName FROM appointment_status");
                           
                                          while (list($appStatName1)= mysql_fetch_array($result_app_stat))
                                       {
                                       print "<option name= \"$appStatName1\" value= \"$appStatName1\">$appStatName1</option>";
                                    
                                    }
                                  print "</select>";
                                  print "</td>";
                                  print "<td class= \"textCenter\">";
                                  print "<input type= \"hidden\" name= \"staffId\" value= \"$staffId\">";
                                  print "<input type= \"hidden\" name= \"patientId\" value= \"$patientId\">";
                                  print "<input type= \"hidden\" name= \"date\" value= \"$date\">";
                                  print "<input type= \"hidden\" name= \"time\" value= \"$time\">";
                                  print "<input type= \"hidden\" name= \"page\" value= \"changeStatus\">";
                                  print "<a href= \"javascript: submitForm()\"> Change </a> ";
                                  print "</td>";
                              }    
                               print "</tr>";
                                print "</form>";
                        }
i don't know what's wrong with this code, but the javascript doesn't work..
this is my js code:
Code:
function submitForm()
{
    document.getElementbyID("form").submit();
}
can anyone help me with this?
thank's alot for your attention..
moccacinoe is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-14-2007, 10:35 AM Re: form submission does not work!
logic ali's Avatar
Super Talker

Posts: 104
Trades: 0
Quote:
Originally Posted by moccacinoe View Post
hi..
i'm using js to submit the form that i have,
my php code is
Code:
for($i=0; $i<$period; $i++)
                         {
                              print "<form name= \"bookAppointment$i\" id= \"bookAppointment\" action= \"../action/bookAppointment.php\" method= \"GET\">";
Why are you using a loop to generate the body of a form?

Quote:
Code:
function submitForm()
{
    document.getElementbyID("form").submit();
}
Why are you trying to submit a form whose id is "form", when the form that you have generated has a totally different id?
logic ali is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to form submission does not work!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09749 seconds with 12 queries