I'm planning to make software that posts topics in a forum. The initial screen will have a menu with all the categories and subcategories, when choosing one I will open in the background a link (link to create a new topic), from there the user will be redirected to another screen in which will have the title and content fields of the topic according to the category.
I want to know how to integrate, for example: Take the text of a "Title" field in my program and put it in input
with id subject
of the html page that is in the background.
Finally, in the submit button I have a Javascript function in onClick
, how do the assignment actions and texts in the inputs and then call the function onClick
?
If you can give me what to research, or an example to follow I would be grateful, as I researched and did not find anything like it.
Considering this HTML code:
<!DOCTYPE html>
<html>
<body>
<h1> Titulo </h1>
<form>
<input type="text" id="subject"/>
<input onclick="envia();" type="submit" id="envia" value="Enviar"/>
</form>
</body>
</html>
How to put text in input
with ID subject
of the page, and when clicking the button the form call the function envia()
of the page?