MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    iFrame Form Issue

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    8 Posts 3 Posters 2.4k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • justjim1220J Offline
      justjim1220 Module Developer @bugman61
      last edited by

      @bugman61

      I’m not seeing the code for your buttons, that’s what needs looked at

      "Life's Too Short To Dance With Ugly People"
      Jim Hallock - 1995

      1 Reply Last reply Reply Quote 0
      • B Offline
        bugman61
        last edited by

        Here is the applicable section from the php file.

        		if (mysqli_num_rows($result) > 0) {
        			
        			while($row = mysqli_fetch_assoc($result)) {
        				
        				echo "<tr><td>" . $row["name"]. "</td>";
        				
        				for($x = 0; $x <12; $x++) {
        					if($row["numstars"] > $x) {
        						echo "<td><img src=\"full_star.png\" width=50 height=50></td>\n";
        					} else {
        						echo "<td><img src=\"empty_star.png\" width=50 height=50></td>\n";
        					}
        				}
        				echo "<td><br><button type=\"submit\" name=\"submitValue\" value=\"A" . $row["id"]. "\">Add</button><br>\n<button type=\"submit\" name=\"submitValue\" value=\"S" . $row["id"]. "\">Remove</button><br>\n<button type=\"submit\" name=\"submitValue\" value=\"R" . $row["id"]. "\">Reset</button></td></tr>\n";
        			}
        		} else {
        			echo "0 results";
        		}
        
        

        Is there a way to post the html source without it getting converted? When I past the table code most of the tags get removed.

        <body>
        	<form action="stars.php" method="post">
        
        		<table>
        	<tr><th></th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th><th>11</th><th>12</th><th>&nbsp;</th></tr>
        	<tr><td>Isla</td><td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><br><button type="submit" name="submitValue" value="A0">Add</button><br>
        <button type="submit" name="submitValue" value="S0">Remove</button><br>
        <button type="submit" name="submitValue" value="R0">Reset</button></td></tr>
        <tr><td>Maggie</td><td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><br><button type="submit" name="submitValue" value="A1">Add</button><br>
        <button type="submit" name="submitValue" value="S1">Remove</button><br>
        <button type="submit" name="submitValue" value="R1">Reset</button></td></tr>
        <tr><td>Nolan</td><td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="full_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><img src="empty_star.png" width=50 height=50></td>
        <td><br><button type="submit" name="submitValue" value="A2">Add</button><br>
        <button type="submit" name="submitValue" value="S2">Remove</button><br>
        <button type="submit" name="submitValue" value="R2">Reset</button></td></tr>
        	</table>
        	</form>
        </body>
        
        justjim1220J 1 Reply Last reply Reply Quote 0
        • justjim1220J Offline
          justjim1220 Module Developer @bugman61
          last edited by

          @bugman61

          I’m not seeing anything wrong with what you’ve posted thus far…

          for html code, add a space after the first <

          < button data-video-src="modules/MMM-MyVideoPlayer/videos/video_one.mp4" class="button">
             <img class = image src="modules/MMM-MyVideoPlayer/posters/one.jpg"></button>
          

          "Life's Too Short To Dance With Ugly People"
          Jim Hallock - 1995

          B 1 Reply Last reply Reply Quote 0
          • B Offline
            bugman61 @justjim1220
            last edited by

            @justjim1220 said in iFrame Form Issue:

            @bugman61

            I’m not seeing anything wrong with what you’ve posted thus far…

            for html code, add a space after the first <

            That gets me this:

            0_1545330462808_Screen Shot 2018-12-20 at 1.26.47 PM.png

            The tags for all the buttons are completely identical except for the text label and the value which is a combination of the row id and A, S or R. I would suspect it has something to do with the page being in an iFrame and/or the browser used by MM.

            1 Reply Last reply Reply Quote 0
            • B Offline
              bugman61
              last edited by

              I have changed the layout a bit and went with smaller + and - buttons on one line. So the required line break no longer messes with the appearance. It’s still very perplexing as to why the one single button never works in the MM.

              0_1545357673608_Screen Shot 2018-12-20 at 8.59.50 PM.png

              brobergB 1 Reply Last reply Reply Quote 1
              • brobergB Offline
                broberg Project Sponsor @bugman61
                last edited by

                @bugman61

                If the same code works in any another position but there I’m guessing that either you have something “above” the buttons that hinders it to be clicked on or you have a formatting error somewhere that renders the buttons not clickable/functioning.

                1 Reply Last reply Reply Quote 0
                • B Offline
                  bugman61
                  last edited by

                  Just to follow up on this, it appears that the issue had something to do with interaction between MMM-Carousel and MMM-iFrame-Ping. The form worked fine with the iFrame module displayed on its own, the issue only presented when it was part of a slide within MMM-Carousel. I have switch my mirror around to use MMM-OnscreenMenu instead and the form behaves as expected now.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy