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:


<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

<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

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” />

That is what I thought too but doing some googling reveal otherwise.

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.

Try the code below and see if it works for you:

<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>

Thank you for that. But it still could not work. The “pointer summary” still cannot be clicked.

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

<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>";} ?>

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’.

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.

Thanks everyone for the advice.

I solve my problem using this 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.

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.

Ok, here’s how you should have done it.

<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>

Unless the background color is non-white otherwise the value Pointer Summary will not show up with color: #fff.

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 :wink: