WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old November 20th, 2007, 06:30 PM
tgkprog tgkprog is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 3 tgkprog User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m
Reputation Power: 0
Arrow WML - Wap setfocus

hi

is there a wmlscript function to be set to run when a page loads (based on a flag - saw a get request variable == 2)

and on that fucntion to set focus to a particular input text box?

Domain: I have a form with 4 text boxes

need to go to the 3rd box when user returns from a particular link

needs to work on phones 2006 and later like the nokia 5300 with latest software

fyi i fill up values with the previous values with cookeis which do work ...

in PHP
Code:
<?php 


    header("Content-type: text/vnd.wap.wml");              // set the content type for WML
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");                       // disable ALL caching
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-cache, must-revalidate");
    header("Pragma: no-cache");
   	echo("<?xml version=\"1.0\"?>\n");
    echo("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"(URL address blocked: See forum rules)\">\n\n");    
?>

<wml>


  <head>
  <meta forua="true" http-equiv="Cache-Control" content="must-revalidate"/>
  </head>
  
  
<card title="SMA1">
<!-- Cabecera con el logo  --> 
   Version 004 		    <br/>

 <p> <small>   Introduzca datos  en el siguiente formulario: </small>
</p> 
<!-- Datos  CRD  -->
<fieldset>
<?php
if(isset($HTTP_COOKIE_VARS["zxp"])) {           // Check if TestCookie is set
      $zxp = $HTTP_COOKIE_VARS["zxp"];         // Read the Cookies
      $vxp = $HTTP_COOKIE_VARS["vxp"];
      $dxp = $HTTP_COOKIE_VARS["dxp"];
      $pxp = $HTTP_COOKIE_VARS["pxp"];
      
    }
    else {      
      $zxp ="";
      $vxp ="";
      $dxp ="";
      $pxp ="";
    }
    
    ?>
<p align="left"> 
<b> Zxxx: </b><input type = "text" format = "*N" name  =  "zxp" maxlength = "2" size = "2" value = "<?php echo $zxp; ?>"/> <br/>
<b> Vxxxx: </b> <input type = "text"  format = "N" name = "vxp" maxlength = "1"  size = "1"  value = "<?php echo $vxp; ?>"/> <br/>
<b> Dxxxxx: </b><a name="dx_anchor"><input type = "text"  format = "*N" name = "dxp" maxlength = "3" size = "3"  value = "<?php echo $dxp; ?>"/></a> <br/>
<b> Pxxxxx: </b><input type = "text"  format = "N" name = "pxp" maxlength = "1" size = "1"  value = "<?php echo $pxp; ?>"/> <br/>

</p>
  </fieldset>


<anchor>
<go href="process_data2.php" method="post">
<postfield name = "zx"  value= "$zxp"  />
<postfield name = "vx" value= "$vxp"  /> 
<postfield name = "dx" value= "$dxp" /> 
<postfield name = "px" value= "$pxp"  />

</go>
Enviar
      </anchor>

<br/>
<!-- zxp 3 is [<?php echo $zxp ; 
?>] -->

<script>
</script>
</card>
</wml>

-----------------------

page which is hit sets the cookies

Code:
//If input is OK
	if(is_numeric($z) && is_numeric($v) && is_numeric($d) && is_numeric($p) 
		&& $z>0 && $v>0 && $d>0 && $p>=0 && strlen($z)<=2 && strlen($v)<=1 && strlen($d)<=3 && strlen($p)<=1
		&& $z!="" && $d!="" && $v!="" && $p!=""){
		
		$HTTP_COOKIE_VARS["zxp"] = $z;
		setcookie ("zxp", $z ."", time()+60*60*24*90 );
		setcookie ("vxp", $v ."", time()+60*60*24*90 );
		setcookie ("dxp", $d ."", time()+60*60*24*90 );
		setcookie ("pxp", $p ."", time()+60*60*24*90 );
		echo "<!-- set cookie zxp to [" . $HTTP_COOKIE_VARS["zxp"] . "] -->";
		$sql = "INSERT INTO Matrix_Values (Z, V, D, P) VALUES ($z, $v, $d, $p) 
				ON DUPLICATE KEY UPDATE P = $p;";
		
		mysql_query($sql, $connection);
		echo "<div align=\"center\">OK, data entered successfully";
	}
	else
	{
		echo "<div align=\"center\">KO, invalid data";
		echo "You entered: z [$z] v [$v] d [$d] p [$p] ";
	}

Reply With Quote
  #2  
Old April 1st, 2008, 10:02 AM
Venos Venos is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 Venos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 m 41 sec
Reputation Power: 0
Has anyone found a solution for setting focus yet?

Regards Hans

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > WML - Wap setfocus


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway