dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: Javascript and Safari problem

  1. #1
    Join Date
    Sep 2010
    Posts
    3

    Javascript and Safari problem

    Hi,

    My partner and I have run into a brickl wall trying to find a solution to a problem we are experiencing. This problem ONLY occurs in Safari and all other browsers have no problem. Here is the code:

    HTML Code:
    <th class="bannerTextRed" id='<?php echo $quotes['idquotes']?>' align="center" onclick="
      	          
              document.getElementById('deleteQuote<?php echo $quotes['idquotes']?>').submit();
             
              
              " onMouseOver="this.style.cursor='pointer';"
     >Delete</th>
    What we are doing is deleting a record from our database. $quotes['idquotes'] gives a unique number for the record which when submited is then run against our delete query. The problem we face is that it works in every browser other than safari. We feel it must be something with our code and would appreciate any suggestions.

    Thank you.

    Also, I have searched everywhere and have not found a reasonable solution to this problem.

  2. #2
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    Offhand I'd say the single quotes in this line need to either be escaped, or the outer pair made double like the rest of your code.

    id='<?php echo $quotes['idquotes']?>'

    May not be the issue but it's the 1st thing I'd try.

  3. #3
    Join Date
    Sep 2010
    Posts
    3
    We have tried this to no avail.

    Whats happening is the action posts to this form:

    HTML Code:
    <FORM id="deleteQuote<?php echo $quotes['idquotes']?>" name="deleteQuote<?php echo $quotes['idquotes']?>" method="post" action="ratingmain.php">
    <input type="text" style="display:none">
    <input type='hidden' name='idquotesDelete' id='idquotesDelete' value="<?php echo $quotes['idquotes'];?>">
           
    </FORM>
    The problem is that the hidden variable is not being posted to the page. And we have proved that by outputting something if the variable was set and nothing was output in Safari. But IE FF output the variable.

  4. #4
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    Just to narrow things down, do you get the same issue with google chrome? It uses the same rendering engine, so it would help to know if it's a browser issue or something to do with the OS itself.

  5. #5
    Join Date
    Sep 2010
    Posts
    3
    I have just tested this in Chrome and it also does not work.

    Any ideas why?

  6. #6
    Join Date
    May 2004
    Location
    Manhattan NY
    Posts
    6,028
    No, not yet. Unfortunately someone else will have to pick this up because I'm about to be traveling for the next 30 hrs or so. Sorry

  7. #7
    Join Date
    Jan 2009
    Posts
    3,346
    What is the result of that code when in the browser? I think it may be much clearer what the problem is once we eliminate the PHP as the source of the trouble (we should be able to eliminate the PHP code as the root problem since the code works in at least one browser).

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles