Jump to content

browser specific submission problem


andyd34

Recommended Posts

I am submitting a form to another page using php and jquery

 

$.ajax({
		type: "POST",
		url: "ajax/schedule.php",
		data: dataString,
		success: function(result) {
			clear_form_elements(bookings);
			$('#calander').html(result);
			//$('#calander').html('ERROR');
		} 

	});
	return false;

 

Everything works fine in chrome and ie but nothing happens in firefox.

 

does anyone have a suggestion as its now doing me head in >:(

Link to comment
https://forums.phpfreaks.com/topic/228230-browser-specific-submission-problem/
Share on other sites

well i added

 

alert (dataString);return false;

 

after

 

var dataString = '&action='+ action + '&selector='+ selector;

 

initially to see if that was the problem but the values are present.

 

It works fine in chrome and ie, its only firefox that i'm having an issue with. i thought it may be a setting on the browser but it isnt

here is ./ajax/schedule.php

 

if($_POST['action']=='lessons' && $_POST['selector']!='');
{
	$date = $_POST['selector'];
	$numeric = explode("/", $date);
	$selected = date('l jS F Y', mktime(0,0,0,$numeric[1],$numeric[0],$numeric[2]));
	$date = mktime(0,0,0,$numeric[1],$numeric[0],$numeric[2]); 
	$week = (int)date('W', $date); 
	$week = str_pad($week, 2, '0', str_pad_left);

	$result = '
	<script>
	$(document).ready(function() {
		$(function(){$("#bookingCal").corner("30px");});
	});
	</script>
	<div id="bookingCal" style="width:616px; margin:10px auto; background-color:#161616">
	<div style="width:614px;margin:1px; padding:3px 0px; text-align:center;"><h2>'.$selected.'</h2></div>';
	for($d = 1; $d <= 7; $d++)
		{
			$hours = date('g a', mktime($i,0,0,0,0,0));
			$paint = '#33FF00';
			$check = 'free';
			$dates[$d] = strtotime($numeric[2].'W'.$week.$d);
			if(mktime(0,0,0,$numeric[1],$numeric[0],$numeric[2]) == $dates[$d]) { $datebg = '#000028'; } else { $datebg = '#000'; }
			$result .= '

			<div style="width:144px; margin:1px; padding:12px 4px; background-color:'.$datebg.'; text-align:left; float:left">'.date('l jS', $dates[$d]).'</div>';
			for($h = 9; $h < 20; $h++)
			{

			$hrbooked = $dates[$d] + ($h * 3600);
			$alt = date('ga l jS F Y', $hrbooked);

			$result .= '
			<div id="date_'.$d.'_'.$h.'" title="'.$alt.'" style="width:32px; margin:1px; padding:12px 4px; background-color:'.$paint.'; text-align:center; cursor:pointer; float:left">'.date('ga', mktime($h,0,0,0,0,0)).'</div>';
			}
		}
	$result .= '
	<div style="width:614px;margin:1px; padding:10px 0px; text-align:center;">last updated '.date('l jS F Y @ g:s a').'</div>';
	echo $result;
}

 

I know this is ok because if i dont use ajax and use a normal submit its working

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.