how to include directions in iframe - google-maps

I have the following form:
<form method="get" action="http://maps.google.com/maps" target="_blank">
<select name="daddr">
<option selected value="Bovetstrasse 1, 3012 Bern, Switzerland">Missione (a Berna)</option>
<option value="">Zollikofen</option>
<option value="">Bümpliz</option>
<option value="">Ostermundigen</option>
<option value="">Münsingen</option>
<option value="">Konolfingen</option>
<option value="">Worb</option>
</select>
<input type="text" name="saddr" maxlength="255" value="">
<input type="hidden" name="hl" value="it">
<input type="hidden" name="z" value="15">
<input type="hidden" name="t" value="m">
<input type="hidden" name="layer" value="t">
<input type="hidden" name="doflg" value="ptk">
<!--input type="hidden" name="output" value="embed"-->
<button type="submit">Guidami</button>
<p class="Didascalia">Powered by Google</p>
</form>
It opens a new window with the map and the directions on the left side as usual.
What I would like to do is to open this content in an iframe that I have in the same page but
if I symply change the target to the iframe name, I get an error (This content cannot be displayed in a frame. To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame.)
if I also un-comment the output=embed parameter, then only the map is shown with the route but no listing of directions
Does any-one know how to do this?

Related

Form with select tag

I have created a search box with select tag but : changes to &more%3A=abc when query is executed. I need to add more:abc or more:xyz when user choose from the select menu.
Is there any other workaround than jQuery?
<form action="test.html" id="searchform">
<input type="search" placeholder="Search here..."
name="q"/>
<input class="submit" type="image" src="icon.png">
<select name="more:" form="searchform">
<option value="">All</option>
<option value="abc">abc</option>
<option value="xyz">xyz</option>

Window.close script doesn't seem to close

Having trouble getting this code to actually close a window. Can anyone help? When the "return" is clicked it just goes to a blank page.
<form method="post" action="http://ww8.aitsafe.com/cf/add.cfm" target="newWindow" onsubmit="window.open('', 'newWindow','width=800,height=500,'+'scrollbars=yes,status=no,toolbar=no,menubar=no,top=200,left=200')">
<p>
<input type="hidden" name="userid" value="A8403475">
<input type="hidden" name="return" value="window.close">
<input type="hidden" name="thumb" value="logo.png">
<select name="productpr">
<option>- Select Size -</option>
<option value="Size one:9.99">Size one - 9.99</option>
<option value="Size two:12.99">Size two - 12.99</option>
</select>
<input type="submit" value="Add to Cart">
</p>
</form>
Defining your code as a value of hidden input field will do nothing in this case.
Create a button and do something similar to this: <button type="button" onclick="window.close();">Close</button>
You didn't specify when you want the window to be closed...

Form not submitting files

For some reason the following form isn't submitting the file like it should and I'm unsure why, on the server side if I check $_FILES it is always empty however if I check say $_POST['article'] that submit just fine, so only the file isn't being received then does anyone see something wrong with this?
<form action="newindex.php?do=submit" enctype="multipart/form-data" method="post">
Subject:<br>
<input type="text" id="subject" name="subject"><br>
<textarea id="article" id="article" name="article"></textarea><br>
<div class="sliderimage"><h2 class="blockhead">Slider Image:</h2>
<table><tr><td><b>Image:</b><br>Dimensions should be 640x360.</td><td>
<input type="file" id="image" name="image"></td></tr>
<tr><td><b>Transition:</b></td><td>
<select id="transition" name="transition">
<option value="">Random</option>
<option value="sliceDown">slideDown</option>
<option value="sliceDownLeft">sliceDownLeft</option>
<option value="sliceUp">sliceUp</option>
<option value="sliceUpLeft">sliceUpLeft</option>
<option value="fold">fold</option>
<option value="fade">fade</option>
<option value="slideInRight">slideInRight</option>
<option value="slideInLeft">slideInLeft</option>
<option value="boxRandom">boxRandom</option>
<option value="boxRain">boxRain</option>
<option value="boxRainReverse">boxRainReverse</option>
<option value="boxRainGrow">boxRainGrow</option>
<option value="boxRainGrowReverse">boxRainGrowReverse</option>
</select></td></tr>
<tr><td><b>Caption:</b></td><td>
<input type="text" id="caption" name="caption"></table><br></div>
<input type="hidden" name="securitytoken" value="<?php echo $vbulletin->userinfo['securitytoken'] ?>" />
<div class="center"><input type="button" value="Preview" class="preview"><input type="submit" name="submit"></div>
</form>
You need to have an input specifying the max file size:
http://www.php.net/manual/en/features.file-upload.post-method.php
put the size attribute in the and this will work.
<input id="image" name="image" type="file" size = '50'"/>

Pass options via PayPal

I'm creating a simple checkout for a client where the visitor can check out via PayPal. Currently, my HTML form looks like this:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<fieldset>
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="sandbox#mcbwebdesign.co.uk" />
<input type="hidden" name="item_number" value="29" />
<input type="hidden" name="amount" value="17.99" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="lc" value="GB" />
<input type="hidden" name="item_name" value="Cohda Design Limited: Design Filter Tee" />
<dl id="product_options">
<dt><label for="option_selection1">T-shirt size:</label></dt>
<dd>
<input type="hidden" name="option_name1" value="T-shirt size" />
<select name="option_selection1" id="option_selection1">
<option value="Small">Small</option>
<option value="Medium">Medium</option>
<option value="Large">Large</option>
<option value="Extra Large">Extra Large</option>
</select>
</dd>
<dt><label for="option_selection2">T-shirt colour:</label></dt>
<dd>
<input type="hidden" name="option_name2" value="T-shirt colour" />
<select name="option_selection2" id="option_selection2">
<option value="Machine Gun Grey">Machine Gun Grey</option>
<option value="Blood Red">Blood Red</option>
</select>
</dd>
</dl>
<label for="quantity">Quantity:</label>
<input type="text" name="quantity" value="1" id="quantity" class="numeric" size="2" maxlength="2" />
<input type="submit" value="Buy now with PayPal or credit/debit card" class="button" />
</fieldset>
</form>
As you can see, a simply form that passes a product's details to PayPal for checkout. However, I'm having a problem with custom options, namely option_name1, option_selection1 etc.
How can I pass custom information such as selected size and colour et al to PayPal for the client—and administrator—to view? As currently, testing the above with the PayPal sandbox feature I can't see any where anything pertaining to custom options.
option_selectX is the name of the parameter in the IPN message. What you'll want to add to the button is this:
<input type="hidden" name="on0" value="Size">Size
<select name="os0">
<option value="Option 1">Option 1 $10.00</option>
<option value="Option 2">Option 2 $12.00</option>
<option value="Option 3">Option 3 $13.00</option>
</select>
<input type="hidden" name="option_select0" value="Option 1">
<input type="hidden" name="option_amount0" value="10.00">
<input type="hidden" name="option_select1" value="Option 2">
<input type="hidden" name="option_amount1" value="12.00">
<input type="hidden" name="option_select2" value="Option 3">
<input type="hidden" name="option_amount2" value="13.00">
Just add 'on1' and 'os1' for colours, etc.
You can create a static button to have a look at the generated code through https://www.paypal.com/buttonfactory
I had trouble passing custom variables as well, and found out that it was the naming convention that I was getting wrong (probably due to outdated docs).
I had been trying to use option_name1 and option_selection, and that wasn't working. After I was this post, I tried option_select0 and option_amount0.
But it wasn't until I finally found this page https://www.paypal.com/us/cgi-bin/webscr?cmd=_pdn_xclick_options_help_outside that I realized it should really be on0 and os0 as the option name and option value variable names.
I hope this saves someone some time!
If I recall correctly, the custom options you're referring to are simply passed back by PayPal to the callback. The premise being you then tie that particular payment to a particular order which would then have all the options you require specified.
I'm not sure if you can get PayPal to do anything with them their end.
Additionally, I don't know how much it has changed, but in my experience the PayPal sandbox can differ significantly from real PayPal, worth noting.

Using a HTML select element to add get parameters to URL

I'm on a page like /gallery.php?place=300&name=place1, and I want it so that when I submit this form it goes to /gallery.php?place=300&name=place1&tag=X, where X is the number of the tag selected.
What's wrong here?
<form action="/gallery.php?place=300&name=place1" method="get">
<select name="tag">
<option value=1>Aerial</option>
<option value=2>Autumn</option>
<option value=4>Boats</option>
<option value=6>Buildings</option>
<option value=7>Canals</option>
</select>
<input type="submit" value="Filter"/>
</form>
Use hidden inputs instead of trying to use the query string twice:
<form action="/gallery.php" method="get">
<select name="tag">
<option value=1>Aerial</option>
<option value=2>Autumn</option>
<option value=4>Boats</option>
<option value=6>Buildings</option>
<option value=7>Canals</option>
</select>
<input type="hidden" name="place" value="300" />
<input type="hidden" name="name" value="place1" />
<input type="submit" value="Filter" />
</form>
Using a form with method get was overwriting the query string in your form action.
This extra parameters seem to work for me locally when using "post" instead of "get." Is that it?