Hello... New to prototype... I know this is probably just really
really simple but i have not been able to find a good tutorial
explination or documetation explination for how to do this... I Would
like this code to update the value of the cust_city form field...

thanks in advance for the help :o)

<CODE>

<script type="text/javascript" src="../prototype.js"></script>
    <script>
                function checkZip() {
                if($F('cust_zipcode').length == 5) {

                        var url = 'ajax.zip_code.php';
                        var params = 'zip=' + $F('cust_zipcode');

                        var ajax = new Ajax.Updater(
                                        {success: 'zipResult'},
                                        url,
                                        {method: 'post', parameters: params, 
onFailure: reportError}
                                );

                        }
                }

                function reportError(request) {
                        $F('zipResult') = "Error";
                }
    </script>

..
...

<input name="cust_zipcode" type="text" id="cust_zipcode" tabindex="6"
size="13" onkeyup="checkZip();" />

<input name="cust_city" type="text" id="cust_city" size="35" />



</CODE>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to