Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOOKIE2K2 1

Status
Not open for further replies.

Sibylle

Technical User
Jul 2, 2001
13
US
This is in regards to automatically filling in form fields (you gave me the whole script for that). Once I input all descriptions, the form no longer worked :-( ... I just can't figure out what I did wrong ... I am a newbie at that. So sorry. Your form worked great before I started fooling around with it ... The url is here:

Sibylle Faye
 
replace :


descriptions[9059] = 'rat CYP 3A23 mRNA - HPSA Drug Metabolizing Enzymes;

with :

descriptions[9059] = 'rat CYP 3A23 mRNA - HPSA Drug Metabolizing Enzymes';

you forgot the ' at the end of the description.

Hope this helps. Gary Haran
 
It's amazing what one little mistake can do to a form ;-) ... I can't tell you how much I appreciated your expertise and helpfulness.

THANKS!
 
now you should also replace :

thefield.value = descriptions[catnum]; // assigns the textarea the value of the description number in the array

with :

thefield.value = (descriptions[catnum]) ? descriptions[catnum] : "" ; // assigns the textarea the value of the description number in the array

Keeps from having undefined in the text field if the user does not fill a proper number. Gary Haran
 
on another note I recommend that you have a mirror of your site. Copy everything into another folder and use that for development purpose. This way you can test your changes without having javascript errors or mistakes appear online if you made a mistake. Gary Haran
 
Thanks, I will arrange for a mirror side.

I uploaded the change you requested (to get red of the "undefined", with one little change, since I wanted people to know that the catalog no. they input is incorrect. The only problem that I see now is that when people don't put any catalog number in, they will also get the note "please verify the catalog number" (or something to this effect). Is there something I can do to change it???

On another note ... And I know I am taking up a lot of your valuable time ... My boss wanted me to put a Radio Button at the shipping address where people only have to click if the billing and shipping address is the same, and the address they put into the billing address is automatically copied over into the shipping address fields.

BTW, if you sell any books relating to Javascripts, please let me know where I can buy one!

Sibylle Faye
 
try

thefield.value = (typeof descriptions[catnum] != "undefined") ? descriptions[catnum] : "Please verify that the catalog number is correct." ;

My confidence with my code often gets me in trouble ! :) that is why the local copy is always good! :) Gary Haran
 
I was asked to put the expanded catalog number (which includes a dash), and now the form doesn't work :-( ...

I put the new form on ... until it works properly. I went over the html and can't figure out what went wrong.

Sibylle Faye
 
Thanks, you got it to work again! I really appreciate it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top