HTML parameters

Asked

Viewed 77 times

1

I’m new to HTML, I’m doing a job for college 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, that is below the image, can as soon as redirected, already go to one of the form fields.

Thank you in advance.

  • 2

    Include your code

  • 6

    It’s good new users on the site, but it’s good to also read the page Tour to learn more about how it works. As you are learning HTML, it is interesting to learn more about using more specific terms: "the name, which is below the image".... That one name referred to would be only one text, and to capture it is necessary to know the structure you are using. That is why it is important to put the HTML snippet in the question, because otherwise it has no way to give a precise answer, because this text can be captured in various ways, depending on how it is on the Cód.

2 answers

0

The solution

This practice is called "Bookmark".

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

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

And at the url of the text, you should add a quill followed by 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 its problem is that I only used "#foo" as a link. If it was on another page (what you want), you can put the full link plus the wire and id.

  • The text below the image is an unedited input, as I do for the text of that input go to in the input of the other page???

  • Put your code reference in the description.

0

Well, guys, I want to thank everyone who’s willing to answer, I solved this problem in a different way, I don’t know if it’s the best way, but it’s been solved in parts. This name that is in an input below an image, I’m picking it up using a Servlet class and returning to a JSP page, somehow worked, but a name for example "XXXX zz YYYY" is coming in JSP only "XXXX". If you have any tips I appreciate it, but thanks to those who responded.

  • I’m sorry, guys, but I was able to solve the problem of appearing only the first name, thank you for your attention and excuse the encomodo

Browser other questions tagged

You are not signed in. Login or sign up in order to post.