How to create multiple submit link buttons? - html

I have two vertical framesets, the left frame will show the links, and the right frame will show the contents when a link is clicked. Right now, what I have is when I click a link, the content is opened in a new tab. I know that to change this we have to change target. I have done so but nothing changed. Can someone help to resolve this problem? Thank you. Here is my code for the part.
<form method="link" action="stock.xml" target="logo.html">
<input id="company.xsl" name="file" type="submit" value="Browse by Company" ><br></br>
<input id="category.xsl" name="file" type="submit" value="Browse by Category" ><br></br>
<input id="sale.xsl" name="file" type="submit" value="Browse by Sale">
</form>
Also, I have 3 xsl files and 1 xml file. Is there any way to link all xsl files to the xml file?

Ok, method should be get or post, the action should be the file that is going to handle the form action, and target should be the name of the from you want it to submit to. see here http://www.developerfusion.com/code/2069/set-the-target-frame-of-a-form/

Related

File upload with a submit button which has a different name

This question may be connected to this Stackoverflow-question:
Form submit button will not submit when name of button is "submit"
Well, I have a basic HTML formular for uploading files which is looking like this:
<form action="UploadServlet" enctype="multipart/form-data" method="POST">
<input type="file" id="uploadName" name="file">
<button type="submit" id="uploadButton" class="btn btn-primary">Upload</button>
</form>
Now, when pressing "Upload" the file is correctly uploaded and processed. But when adding a name attribute to the submit button:
<button id="uploadButton" name="anyname" type="submit" class="btn btn-primary">Upload</button>
Then the request brokes (by using the TamperData plugin in Firefox is seems that the request is being sent as text/html instead of application/...). I tried to find some answers, but the only thing I found was the above mentioned question. I am not sure whether this question is connected to this. I strongly assume that the problem is assigned to "multipart/form-data", isn't it?
It also may be a servlet-problem: when using a name attribute for the submit button I am getting a NullPointerException in org.apache.tomcat.util.http.fileupload.disk.DiskFileItem.getString (due to a request.getParts()-call).
Now that I've found the source of the problem I really want to understand it. Thanks for your replies :-)

Mimic HTML form for uploading a picture

How do I mimic HTML form "Browse" and "Submit" buttons as done in facebook?
My form is:
<form action="upload_file.php" method="post"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
So far I can just do it in the traditional way. But what I really need is:
When the user clicks "Upload Picture" label or button or whatsoever, it mimics "Browse" button and on selecting a picture it mimics "Submit" button events. I don't want to show the odd looking browse and submit buttons...You got my point?
I've used PLUpload for something similar in the past. It is primarily for larger files, but it does the browsing and masking as you desire. I've even set up the JS to auto submit once the image is selected. It doesn't take much as long as you have the basic understanding of JS.
http://www.plupload.com/

input type file invisible on page load

I have this problem Only on IE7 and IE8.
I have a shadowbox that contains an input type file in it.
When this shadowbox is loaded, the input file is invisible... until I mouse hover it.
It's a reall basic form with a really basic input file:
<form action="" method="post" enctype="multipart/form-data" autocomplete="off">
<input type="file" name="img" onChange="$('#button_img').css('display','');" />
<input type="hidden" name="step_crop" value="1" />
<input type="submit" value="" />
</form>
I tried to delete everything on the file and only leave the form with one element which is, yeah, the evil input file, but still invisible on page load until I hover it.
Someone would have an idea ?
(Video link for the behavior: http://www.screenr.com/6ICH )
Please try to close your div and input tags properly. does it work?
Hi, I can see input field in both IE7 and IE8. Can you please add your view how it looks like before and after

how to do forms in html?

How do I do a browse button, that when clicked on will just open the browse box, and store the link to the file in its value, I don't want it to connect to any server or anything (so i'm not sure what to do for the action and method attributes...). Basically after the user browses for a file, they can click another button and an onclick event occurs, but when I try it, it's not functioning properly.
<form action="" method="POST">
<input name="fileupload" id="fileupload" type="file">
<input value="OK" type="submit" onclick="change_bg_img('Untitled.png');">
</form>
You have an input of type="submit". Clicking it will submit the form, so the JavaScript will run, then the page will reload in its default state.
If you don't want to ever submit the data to the server then:
Don't use a <form>
Use type="button" not type="submit"
As mentioned, you don't actually need a form here.
I've made a working example on jsfiddle:
http://jsfiddle.net/h774q/2/
Use a button. And for best practices keep your click event handler out of the markup ;)

i need to make an input that looks like this button

I have a button on an html page declared like so:
<button type="submit" name="action" value="sort">SAVE CHANGES</button>
My company demands we support older versions of IE, and in versions 8 and lower when the user goes to submit the form, it passes the text between the 2 button tags. So i need to use an input tag instead. Can someone help me figure out how to create an input tag where the type=submit, the name=action and the value=sort, but hte text on the button says 'SAVE CHANGES'.
Thanks!
Like this:
<input type="submit" name="action" value="SAVE CHANGES" />
However if the value="sort" is important to you perhaps you could move it to an input type="hidden" element.
An option is to use an image button with the text SAVE CHANGES on it.
<input type="image" src="save_changes.png" name="action" value="sort" />
Don't give your submit button a name, make a hidden field with the name and value you want.
<button type="submit">SAVE CHANGES</button>
<input type="hidden" name="action" value="sort" />
So, when the form is submitted, the value "action=sort" will be submitted.
The requirements seem to exclude solutions other than using <input type=image>, which has serious problems; in particular, the coordinates of the clicked location are transmitted, and probably a revision of the requirements will therefore exclude this, too.
Using JavaScript, you could tweak the data before it gets sent, or maybe use an image with an onclick handler that turns it to a button in a sense.
Normally, problems like this should be solved by modifying the server-side code. But if you have some reason why the field name (in the submitted data) must be different from the text in the button, then there does not seem to be any solution, with the given conditions.