Tag: Contact
How to select selected Html Drop Down and paste it automatically into a Contact Form
first of all its my first question in Stackoverflow, because im hardstuck in a problem right now. So hopefully someone can help me with that.
The project: I am building a Product Configurator for a Website. The main goal is, that customers can configurate their product and the options they selected are automatically placed in a Contact Form.
I am working on WordPress with Elementor. The Plugin I used for the configurator is: "Woocommerce Extra Product options"
My Problem: I need to get the ID’s of the specific selected containers and fill the text of the containers automatically in the Form down below.
The site: https://soundgreets.com/produkt/konfigurator/
Does anyone know how i can do this? Maybe in a .php file? Or in elementor? I did some massive CSS on the site, so that it looks like it is right now. This Selector is to select all containers of the Dropdowns.
.tc-extra-product-options .cpf-type-select .tmcp-field-wrap label.fullwidth select{ color: red; } What i also tried is to use Elementors Html Code-widget to get the variable of the specific Id of a container.
This didnt work: the output is "undefined"
var e = document.getElementById(“tmcp_select_160362915b5ef2”); var strUser = e.options[e.selectedIndex].text; document.write(strUser) I hope someone has an idea on this.
thanks in advance
Berkan
PS: The site could look a bit messy i am sorry for that
Creating a PHP contact page [closed]
I have been working on a small website and wanted to add a contact us page. The rest of the website is just 3 html files and a css style sheet. I have created the form in a fourth html file, contact-us.html, but I am not sure how best the PHP to send the email should work.
I have tried having a separate PHP file, contact-send.php, which is linked to using action="contact-send.php", then this PHP file sends the email, but what the user sees is just a blank page, the contact-send.php page, when they click submit. I want the user to be ideally taken to a page that says success if the form is sent or allows them to make changes if the information entered was not right.
I have seen people have a PHP file for the contact-us page which includes the html for the form, but I didn’t know if it was good to have the code that sends the form visible on the same page.
If I have the PHP to send the email in a separate file, how can this then update the webpage if the email is successfully sent, either by redirecting to a new page or by updating the content of the current one.
This website is just being hosted on Linux servers.
What different files should be used ? Should I have the main contact page be a php file which also sends the message, or should it be a separate file which is then able to redirect the page?
A* algorithm: need help fixing path that come in contact with obstacle
I am using A* as a pathfinding technique for my AI; it works fine until it gets close to an obstacle (in my case rocks). Right now it just continues the loop if it finds a neighbor thats a rock. It should not actually do this. It should check it.
Allowed Moves: FORWARD,LEFT,RIGHT (LEFT & RIGHT at diagonals) turns are basically two phases: FORWARD, turn face then FORWARD (counts as one move with no additional cost)
The AI should know to turn left or right on the rock in the direction of the goal while also taking other rocks into account.
The line that checks for rocks is: if(at == 1 || at == 2) continue;
I guess you could use the neighborlist to check the sides of the ship.
However it shouldn’t always check it. Only when it comes in contact with a rock
Scenario 1: (ship should turn left (one move) once then continue on path)
Scenario 2: (ship should either turn left or right twice (two moves) to unblock itself)
Scenario 3: (ship should turn left or right depending on which path is shorter: doing two lefts will hit rock twice but distance is shorter than if it went right by 1 tile)
In each of these scenarios the face of the ship is the only thing that changes; unless its a forward move into the rock then there is no change. If right/left were used in any other situation (regular tiles) it would change position also.
public class AStarSearch { private ServerContext context; private List<AStarNode> openList; private List<AStarNode> closedList; private double ORTHOGONAL_COST = 1.0; private double DIAGONAL_COST = ORTHOGONAL_COST * Math.sqrt(2.0); public AStarSearch(ServerContext context) { this.context = context; } private Comparator<AStarNode> nodeSorter = new Comparator<AStarNode>() { @Override public int compare(AStarNode n0, AStarNode n1) { if(n1.fCost < n0.fCost) return 1; if(n1.fCost > n0.fCost) return -1; return 0; } }; public List<AStarNode> findPath(Player bot, Position goal){ openList = new ArrayList<AStarNode>(); closedList = new ArrayList<AStarNode>(); List<AStarNode> neighbors = new ArrayList<AStarNode>(); AStarNode current = new AStarNode(bot, bot.getFace(), MoveType.NONE, null, 0, bot.distance(goal)); openList.add(current); while(openList.size() > 0) { Collections.sort(openList, nodeSorter); current = openList.get(0); if(current.position.equals(goal)) { List<AStarNode> path = new ArrayList<AStarNode>(); while(current.parent != null) { path.add(current); current = current.parent; } openList.clear(); closedList.clear(); Collections.reverse(path); return path; } openList.remove(current); closedList.add(current); int x = current.position.getX(); int y = current.position.getY(); switch (current.face) { case NORTH: neighbors.add(new AStarNode(new Position(x, y), VesselFace.NORTH, MoveType.NONE,current,0,0)); neighbors.add(new AStarNode(new Position(x, y+1), VesselFace.NORTH, MoveType.FORWARD,current,0,0)); neighbors.add(new AStarNode(new Position(x-1, y+1), VesselFace.WEST, MoveType.LEFT,current,0,0)); neighbors.add(new AStarNode(new Position(x+1, y+1), VesselFace.EAST, MoveType.RIGHT,current,0,0)); break; case EAST: neighbors.add(new AStarNode(new Position(x, y), VesselFace.EAST, MoveType.NONE,current,0,0)); neighbors.add(new AStarNode(new Position(x+1, y), VesselFace.EAST, MoveType.FORWARD,current,0,0)); neighbors.add(new AStarNode(new Position(x+1, y+1), VesselFace.NORTH, MoveType.LEFT,current,0,0)); neighbors.add(new AStarNode(new Position(x+1, y-1), VesselFace.SOUTH, MoveType.RIGHT,current,0,0)); break; case SOUTH: neighbors.add(new AStarNode(new Position(x, y), VesselFace.SOUTH, MoveType.NONE,current,0,0)); neighbors.add(new AStarNode(new Position(x, y-1), VesselFace.SOUTH, MoveType.FORWARD,current,0,0)); neighbors.add(new AStarNode(new Position(x-1, y-1), VesselFace.WEST, MoveType.RIGHT,current,0,0)); neighbors.add(new AStarNode(new Position(x+1, y-1), VesselFace.EAST, MoveType.LEFT,current,0,0)); break; case WEST: neighbors.add(new AStarNode(new Position(x, y), VesselFace.WEST, MoveType.NONE,current,0,0)); neighbors.add(new AStarNode(new Position(x-1, y), VesselFace.WEST, MoveType.FORWARD,current,0,0)); neighbors.add(new AStarNode(new Position(x-1, y+1), VesselFace.NORTH, MoveType.RIGHT,current,0,0)); neighbors.add(new AStarNode(new Position(x-1, y-1), VesselFace.SOUTH, MoveType.LEFT,current,0,0)); break; } for(AStarNode neighborNode : neighbors) { // Compute the cost to get *to* the action tile. double costToReach = current.position.distance(neighborNode.position); int at = context.getMap().getTile(neighborNode.position.getX(), neighborNode.position.getY()); if(at == 1 || at == 2) continue; // this is the line where it checks if tile is rock or not double gCost = current.gCost + costToReach; double hCost = heuristicDistance(neighborNode.position,goal); AStarNode node = new AStarNode(neighborNode.position, neighborNode.face,neighborNode.move, current, gCost, hCost); if(positionInList(closedList, neighborNode.position) && gCost >= node.gCost) continue; if(!positionInList(openList, neighborNode.position) || gCost < node.gCost) openList.add(node); } } closedList.clear(); return null; } private double getActionCost(Position node, int currentTile) { if(currentTile > 3 && currentTile < 11) { return 0.2; }else { return 1; } } private double heuristicDistance(Position current, Position goal) { int xDifference = Math.abs(goal.getX() - current.getX()); int yDifference = Math.abs(goal.getY() - current.getY()); int diagonal = Math.min(xDifference, yDifference); int orthogonal = xDifference + yDifference - 2 * diagonal; return orthogonal * ORTHOGONAL_COST + diagonal * DIAGONAL_COST; } private boolean positionInList(List<AStarNode> list, Position position) { for(AStarNode n : list) { if(n.position.equals(position)) return true; } return false; } }
AStarNode:
public class AStarNode { public Position position; public VesselFace face; public MoveType move; public AStarNode parent; public double fCost, gCost, hCost; public AStarNode(Position position, VesselFace face, MoveType move, AStarNode parent, double gCost, double hCost) { this.position = position; this.face = face; this.move = move; this.parent = parent; this.gCost = gCost; this.hCost = hCost; this.fCost = this.gCost + this.hCost; } }
There will be no additional cost of running into a rock as long as its a shorter route. Also, if a ship tries to turn left or right from its current position; but there is a rock at that tile it will move up one tile and changes its direction.
The overall question/goal: How do I fix my current code to account for these situations; please provide an implementation or instructions.
How can I add a link to a WPForms “contact us” form to the main menu? [migrated]
I created a basic WordPress site with a main page and a menu on it. WordPress allowed me to add links to pages. But I cannot find a way to add a link to a form created in WPForms. My goal is to have a link open a full-page contact us form.
How do I change the styling of the confirmation for Contact Form 7? [closed]
I’m using Contact Form 7 on WordPress, and when it says ‘Thank you for sending your email’ or something like that, the text comes out white. How can I change the colour to something else – what would the customisation code be?
Ajax contact form widget plugin data not insert in database
I have been working at this for weeks without success. I’ve figured out problem after problem with the code, but none of the corrections seem to fix my core problem. The form doesn’t insert anything into the database and I don’t know why. all my data’s passed in the ajax call but it doesn’t insert in the data in the database.
I’m new to ajax and to WordPress plugins so I might be missing something obvious. Please help me know where I am going wrong. Thanks in advance.
My widget form plugin code
public function widget( $ args, $ instance ) { if ( ! isset( $ args['widget_id'] ) ) { $ args['widget_id'] = $ this->id; } $ title = ( ! empty( $ instance['title'] ) ) ? $ instance['title'] : __( 'Contact' ); $ title = apply_filters( 'widget_title', $ title, $ instance, $ this->id_base ); ?> <?php if ( $ title ) { echo '<h2 class="widget-title">'.$ args['before_title'] . $ title . $ args['after_title'].'</h2>'; } ?> <form class="form-group" method="POST" id="form" action=""> <label>Name</label><br> <input class="form-control" type="text" id="name" name="name" ><br> <label>Mobile</label><br> <input type="text" class="form-control" id="mobileno" name="mobileno" required><br> <label>Email</label><br> <input class="form-control" type="email" id="email" name="email" ><br> <label>Message</label><br> <textarea class="form-control" id="message" name="message" maxlength="10" onKeyPress="lengthcheck()"></textarea><br><br> <button class="btn btn-warning" type="submit" id="submit">Send Message</button> </form> <?php }
This is my enqueue methods:
add_action( 'wp_enqueue_scripts', 'vs_con_enqueue_scripts' ); function vs_con_enqueue_scripts(){ wp_register_script( 'ajaxHandle', plugins_url('valid.js', __FILE__), array('jquery'), false, true ); wp_enqueue_script( 'ajaxHandle'); wp_localize_script( 'ajaxHandle', 'ajax_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); wp_enqueue_style( 'bootstrap-style','https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' ); } add_action( "wp_ajax_contact", "vs_contact_form" ); add_action( "wp_ajax_nopriv_contact", "vs_contact_form" ); function vs_contact_form(){ global $ wpdb; $ name = $ _POST["name"]; $ email = $ _POST["email"]; $ mobileno = $ _POST["mobileno"]; $ messsage = $ _POST["messsage"]; $ tablename = $ wpdb->prefix.'contactdetails'; $ insert_row = $ wpdb->insert( $ tablename, array( 'name' => $ name, 'email' => $ email, 'mobileno' => $ mobileno, 'messsage' => $ messsage ) ); // if row inserted in table if($ insert_row){ echo json_encode(array('res'=>true, 'message'=>__('Message Sent Successfully'))); }else{ echo json_encode(array('res'=>false, 'message'=>__('Something went wrong. Please try again later.'))); } wp_die(); }
Here this is my form submit jquery ajax call function
valid.js
jQuery(document).ready(function($ ){ $ ('form#form').on('submit', function(e){ e.preventDefault(); var name =jQuery('#name').val(); var email = jQuery('#email').val(); var mobileno = jQuery('#mobileno').val(); var message = jQuery('#message').val(); debugger; var text; if(name.length < 5){ text = "Please Enter valid Name"; alert(text); return false; } if(isNaN(mobileno) || mobileno.length != 10){ text = "Please Enter valid mobileno Number"; alert(text); return false; } if(email.indexOf("@") == -1 || email.length < 6){ text = "Please Enter valid Email"; alert(text); return false; } $ .ajax({ url: ajax_object.ajaxurl, type:"POST", dataType:'json', data: { action:'contact', name: name, email: email, mobileno: mobileno, message: message }, success: function(data){ if (data.res == true){ alert(data.message); // success message } }, error: function(data){ if (data.res == false){ alert(data.message); // success message } } }); $ ('#form')[0].reset(); }); });
please help me to find out where I am wrong?
Newsletter signup without service provider – contact collecting
I have a WordPress+WooComerce site and would like to integrate a newsletter sign-up checkbox in the checkout and customer registration page, but without linking to a service provider, because we still have to decide the right service and other details regarding our newsletter strategy. In other words, at this stage, we only want to collect contacts that have given explicit authorization to receive a newsletter. Unfortunately all plugins seem to need an integration with some newsletter service provider like Mailchimp or Sendinblue and we are still deciding which one to use.
Does anybody know a simple way to add the above mentioned checkbox so that we can record the consent given by the customer together with his details and use this to send him/her newsletters in the (near) future?
Tanks in advance.
GSA Website Contact lists, tutorials, resources and more!
Are you struggling with some or all of the contact form sending process?
Do you own GSA Website Contact but find it challenging to get enough contact forms to submit to?
Do you want to be able sell even more products with contact form marketing?
A contact form marketing membership helps solve all of these issues by giving you access to:
Optimal Settings and Configuration
Training materials and Mini Tutorials
400K+ contact lists – prefiltered contact forms – per month
Master Opt Out list
Abuse and Complainer list to help you avoid issues
Information on legal compliance
Resources to help you, including discounts codes, Required Tools, Helpful Tools, Hosting, etc..
Plus more
Currently we are in Phase 2 of development and we are adding mini tutorials and other helpful resources. Phase 3 of development will include a private forum where members can share their experiences and what is working, as well as help other members.
Find out more here:
https://contactformmarketing.com/
Currently this service is in a growth stage and will ultimately be $ 147 per month, however we are currently offering Early Bird pricing to a handful of members. If you sign up at the discounted pricing, you get to keep it for as long as you are a member. Plus you get to give valuable feedback and help shape the future of the membership platform.
The current price is only
$ 147
$ 67 per month
and you keep that price for as long as you remain a member.
The Price will increase to $ 97 on Nov 25th 2020. Then additional increases will follow as more content is added.
Sign up now to grow your business and lock in the price!
Contact Form Submitter – Getting Errors
I am using only one deCaptcha service (Death by Captcha) and when I use my site’s contact page as a test, the result is “Failed general/unknown”. I updated the files in Platforms as suggested here (http://scrapeboxfaq.com/contact-form-poster-says-failed) and still nothing.
My site’s current contact page only has “I’m not a robot” captcha.
Am I missing any settings? What am I doing wrong? I tried a few other websites with the same result.