Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2010
    Posts
    22
    Thanks
    9
    Thanked 0 Times in 0 Posts

    PHP Separate Input Then Joined Address for Online Form

    This is coded in newstyle php which i dont know
    Its an address form but you need to type it in a string which is inefficient and inconsistent.
    I'm trying to split the input into seperate boxes to ensure that it is filled in correctly every time.
    I am proficient with PHP in the old sense but not with the way it is now so a bit confused, i know that to fix it i would need to create separate inputs then a final input which will consist of all the inputs joined in to one. That will then be submitted as the address for the form.

    Its not my code so I dont want to screw with the form too much so I need the the input values for each of them then join together into a string that's the same value that the form is already asking for.

    so string = "'$input 1', '$input2', '$input3'".

    I know what i need to do i just cant do it!!!!

    SPECIFIC CODE PROBLEM AREA:

    Code:
    <label>
    <?php _e( 'Address (street nr., street, town, county, country)', APP_TD ); ?>
    <input id="listing-address" name="address" type="text" value="<?php echo esc_attr( $listing->address ); ?>" class="required" />
    </label>
    FULL FORM:

    Code:
    
    
    
    <form id="create-listing" enctype="multipart/form-data" method="post" action="<?php echo $form_action; ?>">
    <?php wp_nonce_field( 'va_create_listing' ); ?>
    <input type="hidden" name="action" value="<?php echo ( get_query_var('listing_edit') ? 'edit-listing' : 'new-listing' ); ?>" />
    <input type="hidden" name="ID" value="<?php echo esc_attr( $listing->ID ); ?>" />
    
    <fieldset id="essential-fields">
    <div class="featured-head"><h3><?php _e( 'Essential info', APP_TD ); ?></h3></div>
    
    <div class="form-field"><label>
    <?php _e( 'Title', APP_TD ); ?>
    <input name="post_title" type="text" value="<?php echo esc_attr( $listing->post_title ); ?>" class="required" />
    </label></div>
    
    <div class="form-field">
    <?php $coord = appthemes_get_coordinates( $listing->ID ); ?>
    <input name="lat" type="hidden" value="<?php echo esc_attr( $coord->lat ); ?>" />
    <input name="lng" type="hidden" value="<?php echo esc_attr( $coord->lng ); ?>" />
    
    <label>
    <?php _e( 'Address (street nr., street, city, state, country)', APP_TD ); ?>
    <input id="listing-address" name="address" type="text" value="<?php echo esc_attr( $listing->address ); ?>" class="required" />
    
    </label>
    
    <input id="listing-find-on-map" type="button" value="<?php esc_attr_e( 'Find on map', APP_TD ); ?>">
    
    <div id="listing-map"></div>
    
    <script type='text/javascript'>
    /* <![CDATA[ */
    jQuery(document).ready(function() {
    vantage_map_edit();
    });
    /* ]]> */
    </script>
    </div>
    </fieldset>
    
    <fieldset id="category-fields">
    <div class="featured-head"><h3><?php printf( _n( 'Listing Category', 'Listing Categories', $included_categories, APP_TD ), $included_categories ); ?></h3></div>
    
    <div class="form-field" id="categories" <?php echo isset( $included_categories ) ? 'data-category-limit="' . esc_attr( $included_categories ) .'"' : '' ; ?>>
    <?php
    
    if ( !isset( $included_categories ) || $categories_locked ) {
    $label = __( 'Categories', APP_TD );
    } else if ( $included_categories == 0 ) {
    $label = __( 'Categories (choose unlimited categories)', APP_TD);
    } else {
    $label = sprintf( _n( 'Category (choose %d category)', 'Categories (choose %d categories)', $included_categories, APP_TD ), $included_categories );
    }
    
    va_get_edit_categories( $listing, $label, VA_LISTING_CATEGORY, $categories_locked );
    ?>
    </div>
    
    <div id="custom-fields">
    <?php
    if ( !empty( $listing->categories ) ) {
    the_files_editor( $listing->ID, __( 'Listing Files', APP_TD ) );
    
    va_listing_render_form( $listing->ID, $listing->categories );
    }
    ?>
    </div>
    </fieldset>
    
    <fieldset id="contact-fields">
    <div class="featured-head"><h3><?php _e( 'Contact info', APP_TD ); ?></h3></div>
    
    <div class="form-field phone"><label>
    <?php _e( 'Phone Number', APP_TD ); ?>
    <input name="phone" type="text" value="<?php echo esc_attr( $listing->phone ); ?>" />
    </label></div>
    
    <div class="form-field listing-urls web">
    <label>
    <?php _e( 'Website', APP_TD ); ?><br />
    <span>http://</span><input name="website" type="text" value="<?php echo esc_attr( $listing->website ); ?>" />
    </label>
    </div>
    
    <div class="form-field listing-urls twitter">
    <label>
    <?php _e( 'Twitter', APP_TD ); ?>
    <span>@</span><input name="twitter" type="text" value="<?php echo esc_attr( $listing->twitter ); ?>" />
    </label>
    </div>
    
    <div class="form-field listing-urls facebook">
    <label>
    <?php _e( 'Facebook', APP_TD ); ?>
    <span>facebook.com/</span><input name="facebook" type="text" value="<?php echo esc_attr( $listing->facebook ); ?>" />
    </label>
    </div>
    </fieldset>
    
    <fieldset id="misc-fields">
    <div class="featured-head"><h3><?php _e( 'Additional info', APP_TD ); ?></h3></div>
    
    <div class="form-field images">
    <label><?php _e( 'Listing Images', APP_TD ); ?></label>
    <?php the_listing_image_editor( $listing->ID ); ?>
    </div>
    
    <div class="form-field"><label>
    <?php _e( 'Business Description', APP_TD ); ?>
    <textarea name="post_content"><?php echo esc_textarea( $listing->post_content ); ?></textarea>
    </label></div>
    
    <div class="form-field"><label>
    <?php _e( 'Tags', APP_TD ); ?>
    <input name="tax_input[<?php echo VA_LISTING_TAG; ?>]" type="text" value="<?php the_listing_tags_to_edit( $listing->ID ); ?>" />
    </label></div>
    </fieldset>
    
    <?php do_action( 'va_after_create_listing_form' ); ?>
    
    <fieldset>
    <div class="form-field"><input type="submit" value="<?php echo esc_attr( $action ); ?>" /></div>
    </fieldset>
    
    </form>

  • #2
    New Coder
    Join Date
    May 2010
    Posts
    22
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Anyone???

  • #3
    New Coder
    Join Date
    May 2010
    Posts
    22
    Thanks
    9
    Thanked 0 Times in 0 Posts
    Bump please

  • #4
    Regular Coder low tech's Avatar
    Join Date
    Dec 2009
    Posts
    852
    Thanks
    173
    Thanked 94 Times in 94 Posts
    check reply to yr pm
    "The greatest revenge is to accomplish what others say you cannot do."
    ~ Unknown

    I used to be indecisive, but now I'm not so sure.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •