Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- Trying to combine two scripts and open in a new window


RickB - 5:47 pm on Mar 15, 2012 (gmt 0)


Thanks for your reply. Here is what I'm looking for and part of my project. The 17 character word is actually VIN #'s for vehicles. Each Vin is unique and it contains letters and numbers in no specific order and they are always 17 characters long. I'm using the revised script you provided along with another script combined with Regex to search for the Vin # on the page, and plug that Vin # into the form field. Each page the script is on will have the same Vin # on it. I've tested the original expression and it does work but the vin # / 17 char. word has to be the first word and only word on the line for that expression to work. Below is a sample of the html on the page the script will be placed on.

<dl>
<dt><span>Bodystyle</span></dt><dd><span>2 door Hatchback</span></dd>
<dt><span>Drivetrain</span></dt><dd><span>FWD</span></dd>
<dt><span>Engine</span></dt><dd><span>1.3L I-4 cyl</span></dd>
<dt><span>Fuel Type</span></dt><dd><span>regular unleaded</span></dd>

<dt><span>Transmission</span></dt><dd><span>Continuously Variable</span></dd>
<dt><span>Ext. Color</span></dt><dd><span>Blizzard Pearl</span></dd>
<dt><span>Stock Number</span></dt><dd><span>000CS210</span></dd>
<dt><span>Vin</span></dt><dd><span>JTNJJXB07CJ011417</span></dd>


<dt><span>Model Code</span></dt><dd><span>6242</span></dd>


</dl>

With my current script, I know the user can copy and paste the vin # into the form field and click go and it will perform as it should. If for some reason the user types in the wrong vin #, then they will get an error page. I already have the script that will highlight the selected text and paste it into the form field from other test that I've done. That part works but, it is for specific characters that I know are in the page (JTNJ)for testing purposes. If I can auto fill that form field for the user based on a click, then I will have less chances for the user getting an error.


Thread source:: http://www.webmasterworld.com/javascript/4428738.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com