HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 1st, 2009, 06:02 PM
MorgainLeFey MorgainLeFey is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 MorgainLeFey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 23 sec
Reputation Power: 0
VBScript - General - Question - Javascript function called from button does not work

Hi;
I have a page, not totally written by me, that has several forms on it. I need to do a search from a button next to several form fields. I have the javascript code to call from the onclick of the button. It works fine in my test pages, but in the real page the buttons do not work.

I am a db wiz, but I sort of suck on my javascript. Any clues to what might be wrong would be appreciated.

I'll be busy removing things from my page piece by piece till I get it right....lol

Reply With Quote
  #2  
Old July 2nd, 2009, 08:12 AM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Expert (3500 - 3999 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,514 ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 4 Days 7 h 1 m 31 sec
Reputation Power: 396
It's impossible for us to tell without seeing your code...
__________________
Support requests via PM will be ignored!
Route of Queue | The General FAQ Thread | HOW TO POST A QUESTION

Perfectly Impossible - is the eagerly awaited debut release from Jayne Sarah - please buy it - it's really good!


Reply With Quote
  #3  
Old July 2nd, 2009, 12:45 PM
MorgainLeFey MorgainLeFey is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 MorgainLeFey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 23 sec
Reputation Power: 0
Quote:
Originally Posted by ChiefWigs1982
It's impossible for us to tell without seeing your code...


I tried to post the whole page but the site nixed it for containing urls.

Here is the js code and the calls are below.

<Script Language="Javascript">
function searchdbp(form) {
//Phone
FieldVar =form.phone.value;
window.location="searchfields_Dot_asp?MyField=Phone&SearchFor=" + fieldVar;
}
function searchdbc(form) {
//Company
alert("company");
FieldVar =form.company.value;
window.location="searchfields_Dot_asp?MyField=Company&SearchFor=" + fieldVar;
}
function searchdbct(form) {
//Contact
FieldVar =form.contact.value;
window.location="searchfields_Dot_asp?MyField=Contact&SearchFor=" + fieldVar;
}
function searchdbe(form) {
//Email
FieldVar =form.email.value;
window.location="searchfields_Dot_asp?MyField=email&SearchFor=" + fieldVar;
}
</Script>

<input name="PButton" type="button" value="Search" onClick="Searchdbp(this.form)">

Reply With Quote
  #4  
Old July 2nd, 2009, 01:35 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Expert (3500 - 3999 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,514 ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 4 Days 7 h 1 m 31 sec
Reputation Power: 396
I don't know if that's your actual code, or if that's just a typo, but
onClick="Searchdbp(this.form)" won't fire "function searchdbp(form)".

Also, if that is how you're doing your code, it's very convoluted! I'm
sure we could help you come up with a more elegant solution. If you
could post a link to a page with this code on, that would be great!

Just replace the "."s in the link with "dot"s and the forum won't mind

www dot google dot com

Reply With Quote
  #5  
Old July 2nd, 2009, 04:21 PM
MorgainLeFey MorgainLeFey is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 MorgainLeFey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 23 sec
Reputation Power: 0
Narrowed down the issue

There is one form on the page.
Then another form, my buttons are inside of the second form. When I get rid of the first form, the buttons work.

I am wondering if it is related to onclick=(this.form), I'm going to run down the explicit call for the form name.

Reply With Quote
  #6  
Old July 2nd, 2009, 05:16 PM
ChiefWigs1982's Avatar
ChiefWigs1982 ChiefWigs1982 is offline
Cunning Linguist
ASP Free Expert (3500 - 3999 posts)
 
Join Date: Mar 2005
Location: I used to live at home, now I stay at the house
Posts: 3,514 ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)ChiefWigs1982 User rank is Major (30000 - 40000 Reputation Level)  Folding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner FolderFolding Points: 50746 Folding Title: Beginner Folder
Time spent in forums: 1 Month 1 Week 4 Days 7 h 1 m 31 sec
Reputation Power: 396
Are the elements in the same form as the button?

If you can't post a link, can you post the rest of the HTML?

Reply With Quote
  #7  
Old July 2nd, 2009, 11:35 PM
MorgainLeFey MorgainLeFey is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 4 MorgainLeFey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 23 sec
Reputation Power: 0
Question To much code to put Dot in the hole thing...

But if anyone wants to look at the actual page email me and I will send you off a copy. gracemgrady "at" cox "dot" net

This code runs on an intranet, so you can't surf to it. It was started by a Romanian firm, taken over by some programmer that just disappeared and now it landed on me. There was also a Russian firm in the mix, but I'm not sure where.

I am a database professional and my javascript skills (before this project) were limited to little snippits I change to suit my simple needs, if it's extensive javascript I get someone else to do it. I just want to call a page with a button, but I need the value in the input box when I call the page. I'm searching on the value in the input box.

This customer has been through it and deserves a break so I'm trying to get this done myself. And gain enough javascript skills so I don't feel like an idiot every time I see it.

Thanks in advance

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > VBScript - General - Question - Javascript function called from button does not work


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
Stay green...Green IT