Web Analytics Made Easy -
StatCounter Extreme Frustration! - CodingForum

Announcement

Collapse
No announcement yet.

Extreme Frustration!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Extreme Frustration!

    Hey Everyone,

    I am creating an online event manager for a company. Now, they want the ability to add, edit, and delete categories. So far so good, The 'add category' function works perfectly on firefox and internet explorer. The edit, and delete functions do not work for internet explorer. The problem is i am using two submit buttons for the application, and not only that but i am using two image submit buttons. The one submit button, has the value of delete, and the one submit button has the value of edit. There code looks like this:

    Code:
    <input type="hidden" name="browser" value="$browser" />
    <td width="24">
    <button class="mult_submit" type="submit" name="submit_mult1" value="Edit" title="Edit">
    <img src="images/edit_ball.gif" alt="Edit Categories" width="24" height="24" title="Edit Categories">
    </button></td>
    <td width="24">
    <button class="mult_submit" type="submit" name="submit_mult" value="Delete" title="Delete">
    <img src="images/delete_ball.gif" title="Delete Categories" alt="Delete Categories" width="24" height="24">
    </td>
    The Browser variable is something i have set up. Depending of what browser the person is using it will have a value of Mozilla or IE.

    Now the code to handle this is:
    PHP Code:
    if ($browser == 'Mozilla' || $browser != 'IE') {//Firefox browser
        
    $what_to_do=$_POST['submit_mult'];

        if ( 
    $what_to_do == "Edit" ){
            
    edit_cat();
        }
        elseif ( 
    $what_to_do == "Delete" ){
            
    delete_cat();
        }    
    }
    elseif (
    $browser == 'IE'){//IE browser
        
    $what_to_do=$_POST['submit_mult'];    


        if ( 
    strpos($what_to_do'Edit') > ){
            
    edit_cat();
        }
        elseif ( 
    strpos($what_to_do"Delete") > ){
            
    delete_cat();
        }
    }
    else {
    //there browser does not support the page code
        
    print ("Your current browser does not work with this page.");    

    For Firefox (mozilla), the code works flawlessly. For internet explorer, the value of submit_mult is: <IMG title=\"Delete Categories\" height=24 alt=\"Delete Categories\" src=\"images/delete_ball.gif\" width=24>. Hence the reason i created the "strpos()" quick fix. Now the delete function works fine, because i have it find the word delete in the string. This is the result of about 3 hours of frustration. The remaining problem is that now only the delete categories img value is being sent over, no matter which button you clicked on, ethier edit or delete. I'm about ready to scream. Is there and eaiser way to go about doing this? Am i making any sense? My brain feels like it is going to explode in about 2 minutes.

    The final thing i have to show you guys is how the page looks that the
    buttons are on. Maybe it will give you a better idea of what i am working
    with. If you need me to clarify anything please let me know, i will happily do it
    for you. How the buttons look.

    Thanks in advance.
    -Nick
    Last edited by skky1142; Jul 29, 2005, 06:24 PM.
    http://stoproductions.com

  • #2
    Unless...

    Unless... Any of you know an eaiser way to have two submit image buttons for
    internet explorer that can send different POST values. That will solve all of my
    problems too.

    -Nick
    http://stoproductions.com

    Comment


    • #3
      Please read our posting guidelines before creating any more threads

      http://www.codingforum.net/postguide.htm
      Spookster
      CodingForum Supreme Overlord
      All Hail Spookster

      Comment


      • #4
        Try something like this for image submit buttons:
        Code:
        <input alt="descriptive text" type="image" src="name.jpg" name="submit">
        dumpfi
        "Failure is not an option. It comes bundled with the software."
        ....../)/)..(\__/).(\(\................../)_/)......
        .....(-.-).(='.'=).(-.-)................(o.O)...../<)
        ....(.).(.)("}_("}(.)(.)...............(.)_(.))¯/.
        ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
        Little did the bunnies suspect that one of them was a psychotic mass murderer with a 6 ft. axe.

        Comment


        • #5
          Posting Guidelines...

          I assume you were reffering to the guidline that states:
          Type in a subject that summarizes your question

          I do apologize. I did not realize those were the rules , i will not happen again.
          And as for you dumpfi... i will try that fix when i get into work on monday.

          Thanks guys.. and sorry for the rule breaking.
          http://stoproductions.com

          Comment


          • #6
            Why not break the forum up into seperate forums for delete and edit? Then use a hidden form element to track which is taking place.

            Comment


            • #7
              Could you submit the form to two different php pages? One edit.php, the other delete.php? If so, this would work...
              Code:
              <form name="formname" method="post" action="edit_or_delete.php">
              
              <input type="image" src="images/edit_ball.gif" border="0" name="editbtn" 
              value="Edit" onclick="this.form.action='edit.php'">
              
              <input type="image" src="images/delete_ball.gif" border="0" name="deletebtn" 
              value="Delete" onclick="this.form.action='delete.php'">

              Comment


              • #8
                Solved

                Hey Guys,

                Thanks for all your help. I just kinda threw my hands up in disgust though. I decided to throw a drop down list in there with the values 'edit' and 'delete'. It makes my life a whole lot easier. Maybe later i'll get back to tackling this issue. Thank you all for your help though.

                -Nick
                http://stoproductions.com

                Comment

                Working...
                X