SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Kuching, Sarawak
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Remove image or logo from PHP form

    Hi there,

    I have a form here and I insert the image in it earlier. But now i wish to remove the image and something wrong with the function.

    Here's the earlier code:

    PHP Code:
    <form id="form4" name="form4" method="post" action=""><strong style="color:#FFF">&nbsp;&nbsp;
    <label>
    <input type="image" src="image/b_view.gif" name="button7" id="button7" value="Submit" align="top" />&nbsp;&nbsp;<u>Pointer Summary</u>
    </label></strong>
    <input name="y" type="hidden" id="y" value="graph" />
    <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
    <input name="stu" type="hidden" id="stu" value="student" />
    <input name="graph" type="hidden" id="graph" value="insert" />
    <input name="id" type="hidden" id="id" value="lect" />
    </form>
    Modified code to remove image

    PHP Code:
    <form id="form4" name="form4" method="post" action=""><strong style="color:#FFF">&nbsp;&nbsp;
    <label>
    <input type="hidden" src="image/b_view.gif" name="button7" id="button7" value="Submit" align="top" />&nbsp;&nbsp;<u>Pointer Summary</u>
    </label></strong>
    <input name="y" type="hidden" id="y" value="graph" />
    <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
    <input name="stu" type="hidden" id="stu" value="student" />
    <input name="graph" type="hidden" id="graph" value="insert" />
    <input name="id" type="hidden" id="id" value="lect" />
    </form>

    I change the input type to "hidden" and the link seems not functioning anymore. Please advise

  2. #2
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You cannot use hidden for the Submit; otherwise the Submit button will not be shown.

    Also change the style color to any color but white to display Pointer Summary.

    If you just want to remove the image then just change that line to this:

    <input type="submit" name="button7" id="button7" value="Submit" align="top" />

  3. #3
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That is what I thought too but doing some googling reveal otherwise.

    http://www.w3schools.com/tags/att_input_alt.asp

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Kuching, Sarawak
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tom8 View Post
    You cannot use hidden for the Submit; otherwise the Submit button will not be shown.

    Also change the style color to any color but white to display Pointer Summary.

    If you just want to remove the image then just change that line to this:

    <input type="submit" name="button7" id="button7" value="Submit" align="top" />
    Yes, I want to hide the submit button. All I want is just enable the click for the "Pointer Summary". I have tried the way which i have googled but could not get as what i am expected, i just come here.

  5. #5
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Try the code below and see if it works for you:

    PHP Code:
    <form id="form4" name="form4" method="post" action="">
       <strong style="color:#000">&nbsp;&nbsp;
          <label>
         <input type="hidden" name="button7" id="button7" value="Submit" align="top"
             onclick="submit()" />&nbsp;&nbsp;<u>Pointer Summary</u>
          </label></strong>
       <input name="y" type="hidden" id="y" value="graph" />
       <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
       <input name="stu" type="hidden" id="stu" value="student" />
       <input name="graph" type="hidden" id="graph" value="insert" />
       <input name="id" type="hidden" id="id" value="lect" />
    </form>

  6. #6
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Kuching, Sarawak
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tom8 View Post
    Try the code below and see if it works for you:

    PHP Code:
    <form id="form4" name="form4" method="post" action="">
       <strong style="color:#000">**
          <label>
         <input type="hidden" name="button7" id="button7" value="Submit" align="top"
             onclick="submit()" />**<u>Pointer Summary</u>
          </label></strong>
       <input name="y" type="hidden" id="y" value="graph" />
       <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
       <input name="stu" type="hidden" id="stu" value="student" />
       <input name="graph" type="hidden" id="graph" value="insert" />
       <input name="id" type="hidden" id="id" value="lect" />
    </form>
    Thank you for that. But it still could not work. The "pointer summary" still cannot be clicked.

  7. #7
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It can be clicked, it just not showing the pointer. I modified the code to show the pointer. The link below gives you an example:

    http://w-cms.org/test/form.php

    PHP Code:
    <form id="form4" name="form4" method="post" action="">
       <strong style="color:#000">
          <label>
         <input type="hidden" name="button7" id="button7" value="Submit" align="top"
             onclick="submit()" />&nbsp;&nbsp;<u
             style="cursor:pointer;">Pointer Summary</u>
          </label></strong>
       <input name="y" type="hidden" id="y" value="graph" />
       <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
       <input name="stu" type="hidden" id="stu" value="student" />
       <input name="graph" type="hidden" id="graph" value="insert" />
       <input name="id" type="hidden" id="id" value="lect" />
    </form>

    <? if($_POST) {echo "<pre>";print_R($_POST);echo "</pre>";} ?>

  8. #8
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    No, that won't do anything. Input type="hidden" is set as display:none. All that the above does is apply a pointer to the <u>.

    Don't rely on Javascript to post a form. Sure, use it sometimes as something nice, but don't RELY on it.

    You want to get rid of the image? Remove that input. You want to click 'pointer summary' to submit it? Turn pointer summary into '<input type="submit" value="Summary" />' and style it with CSS to remove the button features if you so wish.

    Don't ever think 'How can I modify what I have to make this work', think 'How would I make this from scratch to make it work', and then think 'How can I modify what I have to do just that'.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  9. #9
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I agree with you on everything you said. I was just wanted to help the OP in removing the image from the form. I did suggest using the standard input submit.

  10. #10
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Kuching, Sarawak
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks everyone for the advice.

    I solve my problem using this code:

    PHP Code:
    <form id="form4" name="form4" method="post" action=""><strong style="color:#FFF">&nbsp;&nbsp;
    <label>
    <input type="image" style="display:none;" src="image/BlockContentBullets.png" name="button7" id="button7" value="Submit" align="top" />&nbsp;<u style="cursor:pointer">Pointer Summary</u>
    </label></strong>
    <input name="y" type="hidden" id="y" value="graph" />
    <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" />
    <input name="stu" type="hidden" id="stu" value="student" />
    <input name="graph" type="hidden" id="graph" value="insert" />
    <input name="id" type="hidden" id="id" value="lect" />
    </form>
    I added style="display:none;" into the input. Hopefully this could help someone who have encountered the same problem with me.

  11. #11
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I hope no one uses it because it does not work. At least when I tested it.

  12. #12
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Kuching, Sarawak
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tom8 View Post
    I hope no one uses it because it does not work. At least when I tested it.
    You try the "earlier code" at my earliest post and see whether it is work or not. If you cant get it work as well, I think there is PHP version problem.
    The earlier code is working fine.

  13. #13
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Ok, here's how you should have done it.

    PHP Code:
    <form id="form4" name="form4" method="post" action="">
        <input name="y" type="hidden" id="y" value="graph" /> 
        <input name="student_id" type="hidden" id="student_id" value="<?php echo $row_vstudent['student_id']; ?>" /> 
        <input name="stu" type="hidden" id="stu" value="student" /> 
        <input name="graph" type="hidden" id="graph" value="insert" /> 
        <input name="id" type="hidden" id="id" value="lect" />
        <input type="submit" style="border: none; background-color: inherit; text-decoration: underline; color: #fff; cursor: pointer;" value="Pointer Summary" />
    </form>
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  14. #14
    SitePoint Addict tom8's Avatar
    Join Date
    Mar 2012
    Location
    New Jersey
    Posts
    310
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Unless the background color is non-white otherwise the value Pointer Summary will not show up with color: #fff.

  15. #15
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    It won't anyway; You'll notice that the original <u> is inside a tag with color: #FFF. So if it was seen before, it'll be seen now
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona


Tags for this Thread

Bookmarks

Posting Permissions

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