Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9227517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:06:02+00:00 2026-06-18T05:06:02+00:00

On page load I would like jquery to load the UUID method as a

  • 0

On page load I would like jquery to load the UUID method as a value to the UUID field so that I see it passed as a parameter on submit. This and this SO post helped, but Im still not getting there…

<FORM ACTION="urlAuction.html" METHOD=GET>
 <INPUT TYPE=TEXT NAME="url">
 <INPUT id="uuid" TYPE=TEXT NAME="uuid" VALUE="" >
 <INPUT TYPE=SUBMIT VALUE=Submit>
</FORM>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript"> 
 $(document).ready(function() {
     var $uuid = $('#uuid'); 
         $uuid.val(GUID());
 });
 function GUID ()
 {
  'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
      var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
      return v.toString(16);
 });
}
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T05:06:03+00:00Added an answer on June 18, 2026 at 5:06 am

    Your GUID function lacks a return to return the value it produces for you:

     function GUID ()
     {
         return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c)
         {
            var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
            return v.toString(16);
         });
     }
    

    It looks like it returns something the way you formatted the braces, but in fact the return v.toString(16) belongs to the anonymous callback function being used by replace to populate each digit with a random hexdecimal digit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to load the main part of my page with Jquery (using
I have this jQuery script: $(document).ready(function() { //Focus the first field on page load
I would like to detect when a page load request give to a UIWebView
I would like to check the load speed of each page in a particular
I have been working on a web page and would like to load multiple
On a php page with javascript (jquery) in the urel I would like to
I have the following JQuery code that processes a GET request upon page load:
I would like to call a jQuery pager function (p) defined as: function p(page)
I would like to consider a case that i have an html page and
I have an area on a white html page that I would like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.