Jump to content

Recommended Posts

So I am just going to past it all becuase I am not sure where my problem lies...

 

I need to send all the form values to another page but I have this javascript "view Marker" in the way. I need to do both....

 

I need to send these values:

 

quote id

name

brand

address

city

state

zip

lat

lng

zoom

 

Thanks so much in advance for the help!

 

<?php require_once('../Connections/localmap.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$section = $_POST['id'];
$region = $_POST['region'];

mysql_select_db($database_localmap, $localmap);

switch ($region) {

	case '_dallas':	$query_table = "SELECT * FROM `_dallas` WHERE id='$section'";
	break;
	case '_houston':	$query_table = "SELECT * FROM `_houston` WHERE id='$section'";
	break;
	case '_central':	$query_table = "SELECT * FROM `_central` WHERE id='$section'";
	break;
	case '_east':	$query_table = "SELECT * FROM `_east` WHERE id='$section'";
	break;
	case '_west':	$query_table = "SELECT * FROM `_west` WHERE id='$section'";
	break;
}

$table = mysql_query($query_table, $localmap) or die(mysql_error());
$row_table = mysql_fetch_assoc($table);
$totalRows_table = mysql_num_rows($table);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Admin edit</title>
<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>

<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAl441l-ccfeNi8qRd5Sg0YhTH_JrGsIagqzI2mCfe6sbfpj29kRSTpKIkflpXRMKPuQdaSnvvqRSUeQ" type="text/javascript"></script>
    

<script type="text/javascript">
    //<![CDATA[

var long = <?php echo $row_table['longitude']; ?>;
var lat = <?php echo $row_table['latitude']; ?>;
var zoom = <?php echo $row_table['zoom']; ?>;
    
var map = null;
    var geocoder = null;

    function load() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(lat, long), zoom);
        geocoder = new GClientGeocoder();

	map.addControl(new GLargeMapControl()); 
	map.addControl(new GOverviewMapControl());
      }
    }

    function showAddress(address) {
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
            }
          }
        );
      }
    }

function getlat() {




}

//End of load Function

//]]>
</script>


    <link href="../css/template_css.css" rel="stylesheet" type="text/css" />
</head>

<body style="font-family:Arial, Helvetica, sans-serif"  onload="load()" onunload="GUnload()">

  <table width="100%" border="0"><form id="form1" name="form1" method="post" action="">
    <tr>
      <td colspan="3" align="right" class="style1"> </td>
    </tr>
    
    <tr>
      <td width="14%" height="20" align="right" valign="top"><span class="style1">Quote ID:</span></td>
      <td height="20" align="left"><input type="text" name="quoteid" id="textfield2" value="<?php echo $row_table['quoteid']; ?>" />
      (Quote ID format begins with [region number].[store number])</td>
      
      <td rowspan="17" align="center" valign="top"><div id="map" style="width: 450; height:600px"></div></td>
    </tr>
    <tr>
      <td height="20" align="right" class="style1">Name:</td>
      <td height="20" align="left"><input type="text" name="textfield3" id="textfield3" value="<?php echo $row_table['name']; ?>" /></td>
    </tr>
    <tr>
      <td height="20" align="right"><span class="style1">Store Brand:</span></td>
      <td height="20"  align="left"><select name="jumpMenu2" id="jumpMenu2" onchange="MM_jumpMenu(this,0)">
        <option><?php echo $row_table['brand']; ?></option>
      </select></td>
    </tr>
    <tr>
      <td height="20" align="right"> </td>
      <td height="20"  align="left"> </td>
    </tr>
    
    </form>
    <form action="#" onsubmit="showAddress(this.address.value+' '+this.city.value+' '+this.state.value+' '+this.zip.value); return false">
    
      <td height="20" align="right"><span class="style1">Address:</span></td>
      <td height="20"  align="left"><input type="text" name="address" value="<?php echo $row_table['address']; ?> " /></td>
      </tr>
    <tr>
      <td height="20" align="right"><span class="style1">City:</span></td>
      <td height="20"  align="left"><input type="text" name="city"  value="<?php echo $row_table['city']; ?> " /></td>
    </tr>
    <tr>
      <td height="20" align="right"><span class="style1">State:</span></td>
      <td height="20"  align="left"><input type="text" name="state" value="<?php echo $row_table['state']; ?> " /></td>
    </tr>
    <tr>
      <td height="20" align="right"><span class="style1">Zip Code:</span></td>
      <td height="20"  align="left"><input type="text" name="zip"  value="<?php echo $row_table['zip']; ?> " /></td>
    </tr>
    <tr>
      <td height="20" align="right"> </td>
      <td height="20" align="right">
        <input type="submit" value="View Marker" /></form><form name="details" action="#" id="details" onsubmit="save();" title="details"><input type="submit" value="Save" />
     </td>
    </tr>
   	
    <tr>
      <td height="20" align="right"> </td>
      <td height="20"  align="left"></td>
    </tr>
    <tr>
      <td height="20" align="right"></td>
      <td height="20" align="right"></td>
    </tr>
    <tr>
      <td height="20" align="right"><span class="style1"></span></td>
      <td height="20"></td>
    </tr>
    <tr>
      <td height="20" align="right"><span class="style1"></span></td>
      <td height="20"></td>
    </tr>
    <tr>
      <td height="20" align="right"><span class="style1"></span></td>
      <td height="20"></td>
    </tr>
    <tr>
      <td height="20" align="right"> </td>
      <td width="15%" height="20" align="right" valign="top"><label>
        
      </label></td>
    </tr>
    <tr>
      <td align="right"> </td>
      <td align="right" valign="top"></td>
    </tr>
    <tr>
      <td height="9" align="right"> </td>
      <td height="9" align="right" valign="top"> </td>
    </tr></form>
  </table>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/63778-help-sending-values/
Share on other sites

looks to me like its due to the form has npt been set to send the form anywhere.

 

I could b wrong as i don't know javascript but in your form you have

 

<form action="#" onsubmit="showAddress(this.address.value+' '+this.city.value+' '+this.state.value+' '+this.zip.value); return false">

 

you could try changing the action to the same page or a set page example:

 

action="<?php $_SERVER['PHP_SELF'];?>"

 

or

 

action="page.php"

 

Like i say i could be way off but its worth a try.

Link to comment
https://forums.phpfreaks.com/topic/63778-help-sending-values/#findComment-317865
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.