HTML Parameters

1

I'm new to HTML, I'm doing a college assignment where we can only use HTML, CSS, JavaScript, JSP, Servlet, Java and MySQL database. So far I've created a page with some images, and a name for each image , and when I click on an image, I'm redirected to another page to fill out a form. What I need to know is, how do I make the name, which is below the image, as soon as redirected, already go to one of the form fields.

Thank you in advance.

    
asked by anonymous 19.04.2018 / 14:40

2 answers

0

The solution

This practice is called a "bookmark".

To do this, you need to put an id in the field you want to focus on the other page.

<input type="button" id="foo">

And in the text url, you should add a checkbox followed by the target id (#foo):

<a href="http://www.exemplo.com/outra-pagina#foo"></a>

Functional example and similar to your problem

<a href="#foo">Me leve ao foo!</a>

<h1>Bar</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis rutrum diam at iaculis. Nam nec suscipit quam. Aenean vestibulum metus sit amet ultrices scelerisque. Praesent porttitor est at mi egestas finibus. Sed ultrices nulla dui, vitae vulputate nulla facilisis at. Nunc non congue mauris, id cursus ipsum. Nullam fringilla nisl eu velit lacinia porttitor. Ut venenatis nibh libero, gravida vulputate metus volutpat vitae.</p>

<h1>Biz</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis rutrum diam at iaculis. Nam nec suscipit quam. Aenean vestibulum metus sit amet ultrices scelerisque. Praesent porttitor est at mi egestas finibus. Sed ultrices nulla dui, vitae vulputate nulla facilisis at. Nunc non congue mauris, id cursus ipsum. Nullam fringilla nisl eu velit lacinia porttitor. Ut venenatis nibh libero, gravida vulputate metus volutpat vitae.</p>

<h1 id="foo">Foo</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis rutrum diam at iaculis. Nam nec suscipit quam. Aenean vestibulum metus sit amet ultrices scelerisque. Praesent porttitor est at mi egestas finibus. Sed ultrices nulla dui, vitae vulputate nulla facilisis at. Nunc non congue mauris, id cursus ipsum. Nullam fringilla nisl eu velit lacinia porttitor. Ut venenatis nibh libero, gravida vulputate metus volutpat vitae.</p>
<h1>Bet</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis rutrum diam at iaculis. Nam nec suscipit quam. Aenean vestibulum metus sit amet ultrices scelerisque. Praesent porttitor est at mi egestas finibus. Sed ultrices nulla dui, vitae vulputate nulla facilisis at. Nunc non congue mauris, id cursus ipsum. Nullam fringilla nisl eu velit lacinia porttitor. Ut venenatis nibh libero, gravida vulputate metus volutpat vitae.</p>

<h1>Nullam fringilla nisl eu velit lacinia porttitor</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis rutrum diam at iaculis. Nam nec suscipit quam. Aenean vestibulum metus sit amet ultrices scelerisque. Praesent porttitor est at mi egestas finibus. Sed ultrices nulla dui, vitae vulputate nulla facilisis at. Nunc non congue mauris, id cursus ipsum. Nullam fringilla nisl eu velit lacinia porttitor. Ut venenatis nibh libero, gravida vulputate metus volutpat vitae.</p>

<h1>Bat</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis rutrum diam at iaculis. Nam nec suscipit quam. Aenean vestibulum metus sit amet ultrices scelerisque. Praesent porttitor est at mi egestas finibus. Sed ultrices nulla dui, vitae vulputate nulla facilisis at. Nunc non congue mauris, id cursus ipsum. Nullam fringilla nisl eu velit lacinia porttitor. Ut venenatis nibh libero, gravida vulputate metus volutpat vitae.</p>

<h1>Fitz</h1>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus mollis rutrum diam at iaculis. Nam nec suscipit quam. Aenean vestibulum metus sit amet ultrices scelerisque. Praesent porttitor est at mi egestas finibus. Sed ultrices nulla dui, vitae vulputate nulla facilisis at. Nunc non congue mauris, id cursus ipsum. Nullam fringilla nisl eu velit lacinia porttitor. Ut venenatis nibh libero, gravida vulputate metus volutpat vitae.</p>

The only difference from the previous example and your problem is that I just used "#foo" as a link. If it was on another page (what you want), you can put the complete link plus the link and id.

    
20.04.2018 / 00:59
0

Well guys, I want to thank those who have made themselves available to answer, I have solved this problem in another way, I do not know if it is the best way, but it has been solved in parts. This name is in an input below an image, I'm getting it using a Servlet class and returning to a JSP page, it worked out fine, but a name for example "XXXX zz YYYY" is arriving in the JSP only "XXXX ". If you have any tips I thank you, but thank you to those who answered.

    
20.04.2018 / 02:47