Creating a multiple field form in one row in Avada Theme - wordpress

I’ve got to get the below form code onto a single row like: http://snag.gy/k5yrv.jpg
<form method="GET" action="YOUR_JOBS_PAGE_URL">
<p>
<label for="keywords">Keywords</label>
<input type="text" id="search_keywords" name="search_keywords" />
</p>
<p>
<label for="keywords">Location</label>
<input type="text" id="search_location" name="search_location" />
</p>
<p>
<input type="submit" value="Search" />
</p>
</form>
I’m using Avada Theme Contact Form 7 and I need to create a form with multiple fields in one row will look like this. For example, this uses 3 column sections, one field per column:
div class="fusion-one-third one_third fusion-layout-column fusion-spacing-yes">Your Name (required) [text* your-name]</div>
<div class="fusion-one-third one_third fusion-layout-column fusion-spacing-yes">Your Message [textarea your-message]</div>
<div class="fusion-one-third one_third fusion-layout-column fusion-spacing-yes fusion-column-last">[submit "Send"]</div>
Any ideas?

Surely can you not just do:
<div class="fusion-one-third one_third fusion-layout-column fusion-spacing-yes">[text keywords placeholder "job title, keywords or company name"]</div>
<div class="fusion-one-third one_third fusion-layout-column fusion-spacing-yes">[text location placeholder "city, province or region"]</div>
<div class="fusion-one-third one_third fusion-layout-column fusion-spacing-yes fusion-column-last">[submit "Search"]</div>
Unless I'm misunderstanding your question completely?

Thanks for your help bluewhitew, but I don't think that would work. The full code is below. I missed something out because I don't want a 'Category' field, but I think I left out an important function. As clicking submit should take you to a job list page, with your selection listed.
<form method="GET" action="YOUR_JOBS_PAGE_URL">
<p>
<label for="keywords">Keywords</label>
<input type="text" id="search_keywords" name="search_keywords" />
</p>
<p>
<label for="keywords">Location</label>
<input type="text" id="search_location" name="search_location" />
</p>
<p>
<label for="search_category">Category</label>
<select id="search_category" name="search_category">
<?php foreach ( get_job_listing_categories() as $cat ) : ?>
<option value="<?php echo esc_attr( $cat->term_id ); ?>"><?php echo esc_html( $cat->name ); ?></option>
<?php endforeach; ?>
</select>
</p>
<p>
<input type="submit" value="Search" />
</p>
</form>

Related

Login from WordPress to External Site

I'm trying to do a generalized script for any WordPress theme which will display a 'Login' or 'Sign-In' link, then show login username, pwds fields, and upon Submit POST to another site with the login info and log them in.
I've done some CSS and code in some themes' header.php file like this:
<div class="sign-in-wrapper">
<div class="sign-in-dropdown">
<form name="login" id="sign-in-form"
<?php if($_SERVER['SERVER_NAME'] == "www.mysite.com") { ?>
action="https://secure.mysite.com/"
<?php } ?>
method="POST">
<input type="hidden" name="thisaction" id="thisaction" value="">
<b>User Name:</b>
<input type="Text" name="UserName" size="41" class="forminput1" value="">
<b>Password:</b>
<input type="password" name="pwd" size="41" class="forminput1">
<input type="submit" value="Sign In" name="login" border="0">
</form>
</div>
</div>
<div id="sign-in-link"><a class="sign-in" url="#top">Sign in</a> </div>
It works in some themes but not in others.
Is there a good way to do this?

Shortcode not working on product page

I'm making a plugin and I don't understand why my shortcode doesn't work if I insert into a woocommerce product page.
It does work if I add it elsewhere on another page, just not on product pages.
The shortcode is added very simply:
add_shortcode('testing', 'testingform');
function testingform() {
ob_start();
echo 'Width:<br>
<input type="text" name="width" id="width"><br>
Height:<br>
<input type="text" name="height" id="height"><br>
Scale:<br>
<input type="text" name="scale" id="scale"><br><br>
<input type="submit" name="submit" id="submitbtn"><br>
<button type="button" id="stripbtn">Show Strips</button>
<div class="wallpapercontainer">
<div class="holder">
<div class="wallpaper">
</div>
</div>
<div class="heightbar"></div>
<div class="widthbar"></div>
</div>';
$output = ob_get_contents();
ob_end_clean();
return $output;
}

Display content if woocommerce coupon is valid or invalid or not entered

I am creating a shortcode that will display the coupon code field. I will be placing this short-code on home page I would like to conditionally display some text in the short-code once the coupon is applied.
If the coupon is applied successfully, I would like to display a success message.
If no coupon is applied, I would like to display the coupon code field.
If the coupon entered within the field is invalid, I would like to return "Coupon invalid" with the coupon field.
So far this is what I have to display coupon field:
public static function coupon_field( $atts, $content = null ) {
$output = '';
$output.='<form class="checkout_coupon" method="post">
<p class="form-row form-row-first">
<input type="text" name="coupon_code" class="input-text" placeholder="Discount code" id="coupon_code" value="" />
</p>
<p class="form-row form-row-last">
<input type="submit" class="button" name="apply_coupon" value="Apply Discount" />
</p>
<div class="clear"></div>
</form>';
return $output;
}
I am looking for something that would function similar to this:
public static function coupon_field( $atts, $content = null ) {
$output = '';
if(!isset($coupon_code)){
$output.='<form class="checkout_coupon" method="post">
<p class="form-row form-row-first">
<input type="text" name="coupon_code" class="input-text" placeholder="Discount code" id="coupon_code" value="" />
</p>
<p class="form-row form-row-last">
<input type="submit" class="button" name="apply_coupon" value="Apply Discount" />
</p>
<div class="clear"></div>
</form>'; }
elseif($coupon_code != get_post($coupon->id)){
$output.='<p>coupon invalid </p>
<form class="checkout_coupon" method="post">
<p class="form-row form-row-first">
<input type="text" name="coupon_code" class="input-text" placeholder="Discount code" id="coupon_code" value="" />
</p>
<p class="form-row form-row-last">
<input type="submit" class="button" name="apply_coupon" value="Apply Discount" />
</p>
<div class="clear"></div>
</form>'; }
else{
$output = '<p>coupon applied</p>';
}
}
return $output;
Any and all help would be much appreciated.

Form submit not working on Chrome

I'm experiencing an issue with a booking form displayed on an hotel wordpress website.
It currently works on firefox and edge, but nothing to do with chrome...
Here is my website :
http://terranostra-ariege.com/
The booking form is the big grey block on the center : when you hit "Réserver", then you are redirected to the booking solution with the options you chose.
The form is made this way :
<div id="resa">
<form id="AVP" method="post" action="http://www.secure-hotel-booking.com/Terranostra-Bellevue/2VW1/search" target="_blank">
<input type="hidden" id="language" name="language" value="fr" />
<input type="hidden" id="AVP_arrivalDate" name="arrivalDate" value="" />
<input type="hidden" id="AVP_nights" name="nights" value="" />
<input type="hidden" id="guestCountSelector" name="guestCountSelector" value="ReadOnly" />
<div class="resa_inline_block">
<label for="AVP_list_days" class="resa_block_label"><?php _e('Arrivée','qns'); ?> :</label>
<select id="AVP_list_days" onchange="updateDDay();" class="days"></select>
<select id="AVP_list_months" onchange="setDays();" class="months"></select>
</div>
<div class="resa_inline_block">
<label for="AVP_list_nights" class="resa_block_label"><?php _e('Nombre de nuits','qns'); ?> :</label>
<select id="AVP_list_nights"></select>
</div>
<div class="resa_inline_block">
<label for="selectedAdultCount" class="resa_block_label"><?php _e('Adultes','qns'); ?> :</label>
<select id="selectedAdultCount" name="selectedAdultCount"></select>
</div>
<div class="resa_inline_block">
<label for="selectedChildCount" class="resa_block_label"><?php _e('Enfants','qns'); ?> :</label>
<select id="selectedChildCount" name="selectedChildCount"></select>
</div>
<div class="resa_inline_block bb">
<label for="selectedInfantCount" class="resa_block_label"><?php _e('Bébés','qns'); ?> :</label>
<select id="selectedInfantCount" name="selectedInfantCount"></select>
</div>
<div class="resa_inline_block">
<input type="button" value="<?php _e('Réserver','qns'); ?>" class="submit" />
</div>
</form>
<p><?php _e('Contactez-nous au <span style="font-size: 14pt; font-weight: bold;">05 61 05 52 06</span> pour toute demande ou pour réserver directement','qns'); ?></p>
<script type="text/javascript">
var months = new Array("janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre");
var message='Date en dehors du planning';
</script>
<script type="text/javascript" src="http://www.secure-hotel-booking.com/Terranostra-Bellevue/2VW1/scripts/base.js"></script>
</div>
I first thought it was because I was opening the form action on a new tab, and redirecting the user to an acknowledgments page on the current tab. So i tried to make it the right way with a simple link, and the problem is still there.
Moreover the chrome console is not reporting any error.
Do you have any idea about how I could solve this ?
Thank you very much in advance,
Elliott
Change your input button to submit rather than button:
<input type="submit" value="<?php _e('Réserver','qns'); ?>" class="submit" />

WordPress search not submitting

I am using the following code for a search bar. When you click the submit, it does nothing. It is not even directing to another page. I am using the Understrap theme.
<div id="search">
<form action="/" method="get">
<input type="search" placeholder="Type your search word(s) here" value="<?php get_search_query(); ?>" />
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div>
Make action attribute your site url instead of '/'. Sometime '/' want be useful.
<div id="search">
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
<input type="search" placeholder="Type your search word(s) here" value="<?php get_search_query(); ?>" />
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div>

Resources