- Screen name: bazzapr
bazzapr's Profile
5 Posts
8 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
- 19-Jul-2011 04:11 PM
- Forum: Using jQuery
I know this is relatively easy, even for a novice like myself, but there are several forms on this page and I have absolutely no control over them. The page is provided by a 3rd party and all we can do is add javascript.The form is a google checkout. I need to halt submission (preventDefault) do some stuff and continue the submittion of that form. This is what I have:The FORM:-
<form method="POST" action=https://checkout.google.com/api/checkout/v2/checkout/Merchant/111111>
<input type="hidden" name="cart" value="PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGlu">
<input type="hidden" name="signature" value="11111111111111">
<input type="image" name="Checkout" alt="Checkout"
src="https://checkout.google.com/buttons/checkout.gif?merchant_id=111111111&w=180&h=46&style=white&variant=text&loc=en_US"
height="46" width="180" /></form>
The SCRIPT-
$(
'input:[name=Checkout]').click(function(e) {e.preventDefault()
//DO SOME STUFF HERE//CONTINUE SUBMITTION
});
Thank you for your help.- G'day All,I found this post: http://forum.jquery.com/topic/jsonp-not-working-for-my-domainsIt explains exactly what I want to do. The person who had the problem seemed to have sorted it out but as my knowledge is not to great I am not to sure what he is getting at.I tried various things but to no avail. All I want to do is return data to a calling javascript using type get and datatype jsonp. If I simply Response.Write "[(""id"": ""123""}]" then nothing happens.So whatever the thread I revered to above is doing it seems to be going in the right direction.Thank you for your help.
- 17-Jun-2011 01:06 PM
- Forum: Using jQuery
I have now been playing around for hours trying to figure this out. Swore I would not ask for a solution. Now I have a headache, so I am asking...please.
On one HTML Page (From.htm) I have:
-
<table class="Contents Stylize General">
<tr>
<td class="ProductName">
<a href=">Product 1</a>
</td>
<td align="center" class="ItemQuantity">
<span style="padding: 0; margin: 0;"><input type="text" size="2" name="qty[4df7c1555b822]" id="text_qty_4df7c1555b822" class="qtyInput quantityInput" value="1"/></span>
</td>
</tr><tr>
<td class="ProductName">
<a href=">Product 2</a>
</td>
<td align="center" class="ItemQuantity">
<span style="padding: 0; margin: 0;"><input type="text" size="2" name="qty[4df7c1555b823]" id="text_qty_4df7c1555b823" class="qtyInput quantityInput" value="4"/></span>
</td>
</tr>
</table>
In the calling page (index.htm) I have this:- <script>
function handle(element) {
$(element).each(function() {
var MyHref = TheHref //http://mysite/products/product1.html
var MyHrefInner = TheHrefInner //Product 1
var MyQty = TheQty //The quantity of <input type="text" size="2" name="qty[4df7c1555b822]" id="text_qty_4df7c1555b822" class="qtyInput quantityInput" value="1"/>
});
}$(function(){
var table = $('<table/>');
table.load('From.htm .Contents.Stylize.General', function(){handle(table);});
});
</script>
I somehow, need to get the values as shown in the handle function for each of Products shown in From.htm.
Keep in mind the only thing I know from From.htm is the class names. I have no idea what products are listed or what the input names are. This table is generated by a third party.Assume that index.htm and From.htm are on the same website.Thank you so much for your help.- G'day All,This code works 100% in all browsers Except IE. I am hoping that someone from the JQuery community has had a similiar issue.SNIPPET JSON FILE:
- [..........,{"id": "33","re": "Maranhão"},{"id": "33","re": "Mato Grosso"},{"id": "33","re": "Mato Grosso do Sul"},{"id": "33","re": "Minas Gerais"},{"id": "33","re": "Paraíba"},{"id": "33","re": "Paraná"},{"id": "33","re": "Paro"},{"id": "33","re": "Pernambuco"},{"id": "33","re": "Piauí"},{"id": "33","re": "Rio de Janeiro"},{"id": "33","re": "Rio Grande do Norte"},{"id": "33","re": "Rio Grande do Sul"},{"id": "33","re": "Rondônia"},{"id": "33","re": "Roraima"},{"id": "33","re": "Santa Catarina"},{"id": "33","re": "São Paulo"},...........]
Code:- function GetRegions(CoID)
{
var i=0;
$.ajax({
type: "GET",
url: "http://localhost/JSONFiles/cregions.json",
async: false,
dataType: "json",
success: function(data){
$(data).each(function(){
if (this.id==CoID)
{
if (i==0)
{
$('#st_Region').find('option').remove(0).end().append('<option value="0">Select Your Region</option>').val('0');
}
i++;
$('#st_Region').append('<option value="'+this.re+'">'+this.re+'</option>');
};
}); - if (i==0)
{
$('#st_Region').find('option').remove(0).end().append('<option value="1">No Regions For This Country</option>').val('1');
};
i=0;
},
error: function(jqXHR, textStatus, errorThrown){
alert ('TEXTSTATUS:'+textStatus);
alert ('ERRORTHROWN:'+errorThrown);
alert ('JQXHR:'+jqXHR.responseText);
} - });
};
Alert Output:TEXTSTATUS: parsererrorERRORTHROWN: Invalid JSON: [{"id": "1","re": "Badakhshan"},{"id": "1",".......Rest of File.JQXHR: [{"id": "1","re": "Badakhshan"},{"id": "1","re": "Badgh..........Rest of File
As I have said before this works 100% in ALL other browsers except IE. IE works fine if I remove all special characters.Anybody have any sugestions?Thank you for your help.- 04-Jun-2011 08:10 PM
- Forum: Using jQuery
Howdy All,I know the question begs a question. Why?I have no control over the DB or the Forms. Using 3rd Party based web app.I have this:$(document).ready(function() {
$("#MyButton").click(function (){
$('#CurrentPageInputTextArea').load('jqloadFrom.htm #OtherPageInputTextArea');
});
});It works sort of. Result:.Any help would be great thank you- «Prev
- Next »
Moderate user : bazzapr
© 2013 jQuery Foundation
Sponsored by and others.

