Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
urgent javascript help
Old 11-12-2009, 11:16 AM urgent javascript help
Junior Talker

Posts: 1
Trades: 0
===================[ URGENT ]=================
confirm_state is not working properly..as it uses sajax..it is supposed to get the value of the state ..but the state being a string not working...please help..
........................urgent.................... ....

<?
function search_states($str)
{
//print $str;
//print "<br><pre>";
$number=explode('-',$str);

//print_r($number);
//print $number[0];
if(count($number)==1)
{
$table='states';
$data=array('*'=>'');
$fldarray=array("state"=>$number[0]);
$val=dataSelectSearch($table,$data,$fldarray,$extr a,$orderArray,$orderType);

// print "<pre>";
// print_r($val);

for($i=0;$i<count($val);$i++)
{
$state_name=$state_name."##".$val[$i]['state'];
}
return $state_name;
}
else
{
$strt_val=ord($number[0]); // Ascii of first character
$end_val=ord($number[1]); // Ascii of last character
//print chr($end_val);

for($j=$strt_val;$j<=$end_val;$j++)
{
$table='states';
$data=array('*'=>'');
$fldarray=array("state"=>chr($j));
$val=dataSelectSearch($table,$data,$fldarray,$extr a,$orderArray,$orderType);

for($m=0;$m<count($val);$m++)
{
$state_name=$state_name."##".$val[$m]['state'];
}
}
return $state_name;


}

}

?>

<script>

function confirm_state1(msg)
{
// =============================== [subcategory follows ] =========================

//alert(msg);
var value=msg;
var arr=Array();
arr=value.split("##");



for(i=1;i<=(arr.length-1);i++)
{
//var new_val;


//alert(i);

//var int=Integer.valueOf(arr[i]);
document.getElementById('innercontent').innerHTML= document.getElementById('innercontent').innerHTML+ "<br>&nbsp;&nbsp; <a href='javascript:void(0);' onclick='document.getElementById(state_name).value ="+arr[i]+";' class='small_link1'>"+arr[i]+"</a>";
//document.getElementById('all_state').innerHTML='';
//alert(document.getElementById('innercontent').inne rHTML);



}

}

function showname(val)
{
//alert(msg1);
alert(val);
document.getElementById('state_name').value=val;
document.getElementById('all_state').style.display ='none';

}

function findstate(str)
{
//alert(str);
document.getElementById('innercontent').innerHTML= '';
document.getElementById('all_state').style.display ='inline';
var str1=str;
x_search_states(str1,confirm_state1);
}



</script>
sandip123 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-13-2009, 08:07 AM Re: urgent javascript help
Super Talker

Posts: 139
Name: John Davis
Trades: 0
to define problem you have to provide your expectation of script execution and also the error messages that you've got
__________________
»
Please login or register to view this content. Registration is FREE
- Interactive maps for websites
»
Please login or register to view this content. Registration is FREE
for web developers
MapMaster is offline
Reply With Quote
View Public Profile Visit MapMaster's homepage!
 
Reply     « Reply to urgent javascript help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16598 seconds with 12 queries