简体   繁体   English

如何制作表格(两个输入)将我带到另一页,其选择取决于输入

[英]How do I make form (two inputs) take me to another page which selections depends on the input

I would greatly appreciate any help as Im unable to solve my problem. 由于我无法解决我的问题,我将不胜感激。 Im grateful for any comment on what tech or backend stuff do i learn for this to work or simply for anything that moves me forward. 非常感谢我对我能学到的技术或后端材料的评论,或者仅仅是让我前进的任何事物。

Thanks in advance ! 提前致谢 !
PS: Im second grade IT high school student, this is different lvl than we have learned so far and im just keen on solving this form. PS:我是IT中学二年级的学生,这与我们到目前为止所学的完全不同,我只是热衷于解决这种形式。

I managed to do: 我设法做到了:

I created a form which is consisted of two text inputs. 我创建了一个包含两个文本输入的表单。 The user would type in (example) place1 (place where he beggins) and place2 (place where he wanna go). 用户将输入(例如) place1(他开始乞讨的地方)和place2(他想去的地方)。 It would autocomplete what is he writting and this would be the only valid inputs. 它将自动完成他写的内容,这将是唯一有效的输入。 I prepared Place 1 - Place 5 我准备了地方1-地方5

I need help with : 我需要以下方面的帮助:

Then it decides which page would be adequate to what the user typed in, for example user typed in Place 1 and Place 5, after he clicks the submit button he is redirected to a site which displays information on what he can visit on his way from Place 1 to Place 5. I dont care about the information he gets, im interested only in how do I create something that redirects the user accordingly on what he typed in. 然后,它决定哪个页面适合用户键入的内容,例如,用户在“场所1”和“场所5”中键入的内容,在他单击“提交”按钮后,将其重定向到一个网站,该网站显示有关他可以从中访问的信息将位置1放置到位置5。我不在乎他获得的信息,我只是对如何创建可将用户相应地重定向到他所输入内容的内容感兴趣。

The code is in here: 代码在这里:
https://github.com/lukasbryla/FORM-PROBLEM https://github.com/lukasbryla/FORM-PROBLEM

Many thanks in advance ♥ 预先感谢♥

This is pretty simple if you are using php. 如果您使用的是php,这非常简单。 There is an excellent example on this site , along with other helpful info. 这个站点上有一个很好的例子,以及其他有用的信息。

Look into the GET method towards the end of that page, that is probably the simplest for this. 查看该页面末尾的GET方法,这可能是最简单的方法。

I would suggest that instead of redirecting the user according to their choices, you would have the form send the used to a results page that will have content generated by their choices. 我建议您不要让用户根据他们的选择重定向,而是将表单发送到使用结果的页面,该页面将包含根据他们的选择生成的内容。

If you can't use PHP, you can do a similar sort of thing with javascript using the GET method. 如果您不能使用PHP,则可以使用GET方法使用javascript做类似的事情。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 vue.js 如何将图像制作为允许我路由另一个页面的按钮 - Using vue.js how do I make an image as a button which allows me to route another page 如何获取2个数字输入字段的值,然后使用Jquery进行除法并将结果显示给另一个输入? - How do i take values of 2 input fields which are numbers, then divide using Jquery and display the result to another input? 如何使此多次登录将我带到代码中的另一个 html? (JavaScript) - How do I make this multi-login take me to another html within my code? (JavaScript) 如何确定宽度取决于输入? - How do I make sure that the width depends on the input? 如何从 2 个用户输入中获取天数,然后将其与另一个用户输入相乘,即 JavaScript 中的金额? - How do I get the number of days from 2 user inputs and then multiply it with another user input which is amount in JavaScript? 如何获取在表单中输入的电子邮件地址,并在另一页上的其他表单中自动填写该电子邮件地址? - How do I take an email address entered in a form, and autofill it in another form on a different page? 如何选择表格到另一个页面? - How do I make a form selection go to another page? 我如何使“日期选择器表单生效”并且仅接受两个月前的输入 - how do i make a “date picker form validate” and only accept inputs that are two months ahead 如何基于输入有条件地隐藏输入表单的某些部分? - How do I hide parts of an input form conditionally based on inputs? 如何通过用户输入在屏幕上显示多个选择? - How do I make multiple selections show up on the screen with their user input?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM