TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-10-2009, 08:49 AM   #1 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 178
Thanks: 9
captainmerton is on a distinguished road
Default Javascript not working on iPhone

I've noticed the javascript on a website i'm building works fine in IE & Firefox but not on Safari on my iPhone. Any ideas how you get javascript to work on an iPhone?
captainmerton is offline  
Reply With Quote
Old 11-10-2009, 01:59 PM   #2 (permalink)
how quixotic are you?
 
ETbyrne's Avatar
 
Join Date: Dec 2007
Location: Lapeer, MI
Posts: 445
Thanks: 37
ETbyrne is on a distinguished road
Default

Does it work on Safari on your computer? It also helps to show what javascript you are using.
__________________
Dingo Web Systems > http://www.dingocode.com
My Website > http://www.evanbot.com
ETbyrne is offline  
Reply With Quote
Old 11-10-2009, 08:46 PM   #3 (permalink)
The Acquainted
 
captainmerton's Avatar
 
Join Date: May 2009
Posts: 178
Thanks: 9
captainmerton is on a distinguished road
Default

The javascript works in safari on my laptop using XP. It doesnt however work on my iphone. What i'm asking is "anybody have experience of this situation?"

In any case here's an example of some the javascript which works on safari on my laptop:

PHP Code:
function inviteFormVerifyMe(){
var 
msg='';

if(
document.getElementById('email').value==''){
    
msg+='- Email\n\n';}

if(
document.getElementById('retypeemail').value==''){
    
msg+='- Retype Email\n\n';}

if(
msg!=''){
    
alert('The following fields are empty or invalid:\n\n'+msg);
    return 
false
}else{
    return 
true }


The function is called here:

PHP Code:
        public function displayform() {
            
$yourname '';
            if (isset(
$_POST['yourname'])) {
                
$yourname $_POST['yourname'];
            }
            
$message '';
            if (isset(
$_POST['message'])) {
                
$message $_POST['message'];
            }
            
$email '';
            if (isset(
$_POST['email'])) {
                
$email $_POST['email'];
            }

            
$form '';

            
$form .= "<div id='inviteform'>";
            
$form .= "<form name='invite' action='invites.php' method='POST' enctype='application/x-www-form-urlencoded' onsubmit='return inviteFormVerifyMe();'>";
            
$form .= "<table class='invite' cellspacing='0'>";
            
$form .= $this->displayError();
            
$form .= "<tr>";
            
$form .= "<td><LABEL for='yourname' ACCESSKEY='none' >Your Real Name:</td>";
            
$form .= "<td><input type='text' name='yourname' id='yourname' size='30' maxlength='100'  value='".$yourname."'></td>";
            
$form .= "</tr>";
            
$form .= "<tr>";
            
$form .= "<td><LABEL for='message' ACCESSKEY='none' >Message:</td>";
            
$form .= "<td><textarea name='message' id='message' cols='23' rows='10' value='".$message."'></textarea></td>";
            
$form .= "</tr>";
            
$form .= "<tr>";
            
$form .= "<td><LABEL for='email' ACCESSKEY='none' ><b class='red'>*</b>Email:</td>";
            
$form .= "<td><input type='text' name='email' id='email' size='30' maxlength='100'  value='".$email."'></td>";
            
$form .= "</tr>";
            
$form .= "<tr>";
            
$form .= "<td><LABEL for='retypeemail' ACCESSKEY='none' ><b class='red'>*</b>Retype Email:</td>";
            
$form .= "<td><input type='text' name='retypeemail' id='retypeemail' size='30' maxlength='100'  value=''></td>";
            
$form .= "</tr>";
            
$form .= "<tr>";
            
$form .= "<td colspan='2' align='right'><input type='submit' name='submit' value='Send'><input type='hidden' name='token' value='".$_SESSION['token']."' /><br /></td>";
            
$form .= "</tr>";
            
$form .= "</table>";
            
$form .= "</form>";
            
$form .= "</div>";

            return 
$form;
        
        } 
captainmerton is offline  
Reply With Quote
Old 11-11-2009, 10:54 AM   #4 (permalink)
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Javascript seems to work perfectly on mine, what version do you have?
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easily Format JSON using PHP and Interpret using Javascript Wildhoney Advanced PHP Programming 13 02-01-2013 11:05 AM
Building Javascript PHP problem captainmerton Absolute Beginners 2 10-31-2009 10:02 AM
javascript question allworknoplay Javascript, AJAX, E4X 15 04-23-2009 09:30 AM
Part 1: Getting Started with Javascript and DOM Wildhoney Javascript, AJAX, E4X 6 11-08-2007 12:52 PM
Preventing Spam with PHP and Javascript Wildhoney General 9 10-24-2007 11:35 AM


All times are GMT. The time now is 05:58 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design