1

I'm trying to pre-populate an input field on a webpage using just an URL. I would like to have users automatically have their connote number entered into the following webpage:

http://www.directfreight.com.au/ConsignmentStatus.aspx

Something along the lines of:

http://www.directfreight.com.au/ConsignmentStatus.aspx?txtConnote=12345

I think it has something to do with the following hidden fields:

__EVENTTARGET

__EVENTARGUMENT

__EVENTVALIDATION

I've tried different combinations and have gotten the page to spit back some errors. Can this be done?

08Dc91wk
  • 4,254
  • 8
  • 34
  • 67
AshyB
  • 11
  • 1
  • 1
    It's something like (http://stackoverflow.com/questions/979975/how-to-get-the-value-from-the-url-parameter) that are you looking for? – Pablo Aug 27 '15 at 13:46

1 Answers1

0

here is a solution:

$(document).ready(function(){
    var myId = document.location.search.replace('?txtConnote=','');

    console.log(myId);
    $('#inputBox-id').val(myId);
});

the input field

<input id="inputBox-id" type="text" placeholder="sample">
Leo Javier
  • 1,383
  • 12
  • 19
  • Unfortunately I don't have access to the website code so I can't do it that way. Has to be via url just the way it is. But that is useful code I'll bookmark for another project – AshyB Aug 27 '15 at 22:43