Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-26-2011, 11:11 PM   PM User | #1
selenin
New Coder

 
Join Date: Jun 2010
Posts: 17
Thanks: 1
Thanked 0 Times in 0 Posts
selenin is an unknown quantity at this point
Multiple Forms

Hi
Back again with a problem, I try to make multiple forms but my code is not working and I'm an Ajax beginner. I use jquery 1.4.2, that's my code:

Quote:
$(document).ready(function()
{
$(".comment_submit").click(function(){


var element = $(this);
var Id = element.attr("id");


$('#videoForm'+Id).submit(function(){$('input[type=submit]', this).attr('disabled', 'disabled');});
function sendVIDEO ( ) {
var videoid = $("#videoid"+Id);
var memberid = $("#mem_id"+Id);
var active = $("#active"+Id);
var credits = $("#credits"+Id);
var video_wipit = $("#videoWipit"+Id);
var url = "scripts/video_parse.php";
if (videoid.val() == "") {
$("#videointeractionResults"+Id).html('<img src="images/round_error.png" alt="Error" width="31" height="30" /> &nbsp; Video not found.').show().fadeOut(6000);
} else if (memberid.val() == "") {
$("#videointeractionResults"+Id).html('<img src="images/round_error.png" alt="Error" width="31" height="30" /> &nbsp; Member not found.').show().fadeOut(6000);
} else {
$("#videoFormProcessGif"+Id).show();
$.post(url,{ video: videoid.val(), member: memberid.val(), actyesno: active.val(), creditsNr: credits.val(), vidWipit: video_wipit.val() } , function(data) {
$('#videoprivate_message'+Id).slideUp("fast");
$("#videointeractionResults"+Id).html(data).show().fadeOut(10000);
document.pmForm.active.value='';
document.pmForm.credits.value='';
$("#videoFormProcessGif"+Id).hide();
});
}
}

return false;});});
and with this php code I want to call the form:

PHP Code:
 $msg_id uniqid (false);
$saveq dbquery("SELECT * FROM videos WHERE youtube_id = '".$vidid."'");
$checkvideo dbrows($saveq);

        if(
$checkvideo == 0):
              print 
"<form action=\"javascript:sendVIDEO();\" name=\"videoForm\" id=\"videoForm".$msg_id."\" method=\"post\">";
      print 
"<input type=\"hidden\" id=\"videoid".$msg_id."\" name=\"videoid\" value=\"".$vidid."\">";
      print  
"<input name=\"mem_id\" id=\"mem_id".$msg_id."\" type=\"hidden\" value=\"".$_SESSION['id']."\" />";
      print 
"<br>";
      print      
"Site active?";
      

      print 
"<input  name=\"active\" id=\"active".$msg_id."\" value=\"1\" type=\"checkbox\"  >";
     
      
      print 
"<br>";
      print 
"Credits <input type=\"text\" id=\"credits".$msg_id."\" name=\"credits\" value=\"\" size=\"1\" maxlength=\"1\" >";
     
      print 
"<br>";
      print  
"<input name=\"videoWipit\" id=\"videoWipit".$msg_id."\" type=\"hidden\" value=\"".$thisRandNum."\" />";
      
      print 
"<input type=\"submit\" value=\"Comment_Submit\"  class=\"comment_submit\" id=\"".$msg_id."\" />";
      
      print 
"<span id=\"videoFormProcessGif".$msg_id."\" style=\"display:none;\"><img src=\"images/loading.gif\" width=\"28\" height=\"10\" alt=\"Loading\" /></span></form>"
I have a lot of forms that's why I need uniqid(), but the whole thing is not working...
selenin is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 02:10 AM.


Advertisement
Log in to turn off these ads.