简体   繁体   中英

how to use a hidden field for multiple form submition

I have a form that i want to filled up by the end user in few steps. in the first step i want to let them fill Name,Address,Mobile number. And when click next button i want to appear another part of the form to fill the other details such as upload a image . i did research online,i found 2 articles useful, One thing is about sessions and the other thing is about hidden fields. In my opinion i think sessions are not a good way to use for form submitting.Because some browsers are might have disabled sessions. So ill go with hidden fields.

In my database i have a unique id which is auto increment.What i want to do is to let user to submit a form.In the first step i want them to submit their name,addres,mobile number(In this time it is inserting data to the database- Only for couple of columns.) And in my database i have a field for upload a image.In the first step it gets a null value.I want to update that null value in the next step by getting a that id from the first step

Please give me the basic idea to start this.A little help much appreciated! Thanks in advance

you can try like this:-

You can add a class on the input which you want to hide

<input type="text" name="example" class="inputHidden">

after that add style in your page like this

<style>
.inputHidden{
    display:none;
}
</style>

If you're trying to place the form data into new, hidden inputs - take the initial input.

<input type="text" name="example">

On the next page add a hidden input.

<input type="hidden" name="exampleP2" value="<?php echo $_POST['example']; ?>">

您可以获取表单提交的数据并在输入隐藏文件中使用它,例如在第一个表单中您有姓名,电子邮件等其他表单中的字段您在这里有更多字段您可以使用<input type="hidden" name ="firstname">和因此您可以添加任意数量的

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM