[jQuery] Re: getElementById with ajax

2009-02-01 Thread Manowar721

efet,

I haven't messed with .asp.  Only ever use .php, so am not too sure
how this will work for you.  But I thought I would provide this
example code below to illustrate how it might work.  After you read
through the links gmacgregor gave you, perhaps you can tweak it and
get it to work to your desires.

   // index.asp
   // Perhaps part of index.asp is structured like so...
   input type=text id=ReceiverPostalCode /
   input type=text id=ReceiverCountry /
   a href= id=getResult /
   div id=shipWrapper/div

   // shipping.js
   // Assuming ship.asp outputs the result to a div
   // with an id of result (ie div id=result/div).
   $(document).ready(function(){

 var postCode = $(#ReceiverPostalCode).val();
 var postCountry = $(#ReceiverCountry).val();
 var url = ship.asp?ShippingPostalCode= + postCode +
%ShippingCountry= + postCountry;

 var getShipping = function(){
   url +=  #result;
   $(#shipWrapper).html('div id=shippingResult/div');
   $(#shippingResult).hide();
   $(#shippingResult).load(url).show();
   return false;
 };

 $(#getResult).bind(click,getShipping);

   });

I didn't test this...but should get you started in the right
direction.

Hope this helps,
Manowar721

On Jan 31, 10:55 am, efet efetun...@gmail.com wrote:
 This will be my first application with using jQuery library, so I
 might not make sense. I will try to explain what I want to do as
 simple as possible.

 I have two web pages, index.asp, ship.asp.

 index.asp: I have a form with ReceiverPostalCode and ReceiverCountry
 inputs.
 ship.asp: this is where I submit form inputs from index.asp to receive
 shipping quotes.

 For example, I get quotes at
 ship.asp?ShippingPostalCode=02116ShippingCountry=US

 When customer enters ReceiverPostalCode and ReceiverCountry on
 index.asp, I want quotes immediately appear in index.asp. How do I do
 this basing my codes on jQuery?


[jQuery] Re: getElementById with ajax

2009-01-31 Thread gmacgregor

On Jan 31, 12:55 pm, efet efetun...@gmail.com wrote:
 When customer enters ReceiverPostalCode and ReceiverCountry on
 index.asp, I want quotes immediately appear in index.asp. How do I do
 this basing my codes on jQuery?

Assuming ship.asp returns some kind of value, you simply make a Ajax
request to ship.asp and do what you will with the response in
index.asp. Probably best to read up on both Ajax and jQuery's Ajax
implementation:

https://developer.mozilla.org/en/AJAX
http://docs.jquery.com/Ajax

Good luck!