I'm building an internal peoples directory using wp for a client. I'm styling the search form and the search result page that are working fine. I need some help to understand what's the better approach to save the user submitted data, I got a form that will hold four fields and a modal popup that will show a map that locate the user and to store the lat and lng info. Someone suggested me to use a custom post type to do this, but I'm not sure about, this because the information will be accessibile by users only by doing a search, and the link to every page will be a map that will display a marker at the lat and lng stored. Can someone help me to reach my goal?
Here is my data sumbission form that will be in a dedicated page:
<?php get_header(); ?>
<div class="container">
<div class="row justify-content-center">
<div class="col-sm-12 col-md-6 col-lg-6 shadow-lg" style="padding:1em;">
<form method="POST" action="">
<div class="form-row">
<div class="col-sm-12 col-md-6 col-lg-6">
<label><?php _e('First Name'); ?></label>
<input type="text" class="form-control" id="" name="" placeholder="Nome">
</div>
<div class="col-sm-12 col-md-6 col-lg-6">
<label><?php _e('Last name'); ?></label>
<input type="text" class="form-control" id="" name="" placeholder="Cognome">
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<label><?php _e('N'); ?></label>
<input type="date" class="form-control" id="" name="">
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<label><?php _e('M'); ?></label>
<input type="date" class="form-control" id="" name="">
</div>
<div class="col-sm-12 col-md-4 col-lg-4">
<label><?php _e('Position'); ?></label>
<button class="btn btn-outline-primary" id="" href="#"><i class="fas fa-map-marker-alt"></i></button>
</div>
</div>
<button type="" class="btn btn-outline-secondary"><?php _e('Add'); ?></button>
<button type="reset" class="btn btn-outline-danger"><?php _e('Cancel'); ?></button>
</form>
</div>
</div>
</div>
<?php get_footer(); ?>
I didn't write the logics when the form is submitted, I want to use ajax, but not sure about, this because I need to lock the submit button until a position is registered.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744866282a4597994.html
评论列表(0条)