Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

onLoad and onSubmit question

Javascript coding ..

Moderators: macek, egami, gesf

onLoad and onSubmit question

Postby denis300 » Mon Jan 10, 2011 7:43 pm

Hi everyone,

The issue I am having is wrapping my mind around this situation. I have html tables and each row will need to be retrieved from the database when the page is loaded. ex. questions with answers loaded from database.

Now, when someone answers the questions, they will be submitted to the database. Is it possible to have an onLoad(load questions and answers), and onSubmit(submit answers), on the same line for each row in the table?

Thanks in advanced.
New php-forum User
New php-forum User
Posts: 1
Joined: Mon Jan 10, 2011 7:39 pm

Re: onLoad and onSubmit question

Postby mayhemiz » Tue Jan 18, 2011 10:55 am

Try to use jquery and ajax,that would work.
Here some help:
Code: Select all
function Search(str,type,from)
if (str == '') {
alert('You cannot search for nothing!');
} else {
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
   var myTD=document.getElementById('left');

This is a code what i was use =)
New php-forum User
New php-forum User
Posts: 38
Joined: Thu Dec 09, 2010 8:13 am

Re: onLoad and onSubmit question

Postby Prensil » Sat May 14, 2011 12:34 am

I think you can ajax to submit each answer from a row but for onload event you need to think...

Thanks & Regards,
Prensil Technologies Pvt. Ltd.
php web development company
New php-forum User
New php-forum User
Posts: 81
Joined: Sat May 07, 2011 12:05 am

Re: onLoad and onSubmit question

Postby gandahar » Wed Jul 06, 2011 10:32 am

if you dont want tu use ajax or jquery, you can use a simple form with target="myIFRAMEname" and send data via the hidden iframe to the php script, just like a normal form, but with the target targeting to the iframe :)

i use this solution in my projects
User avatar
New php-forum User
New php-forum User
Posts: 112
Joined: Tue Mar 15, 2011 4:05 am

Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.