473,468 Members | 1,448 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Code not going to JS Validation

3 New Member
Hi there,

I have written a registration form with the following code which takes it to a separate JavaScript validation page:

Expand|Select|Wrap|Line Numbers
  1. <script type = "text/javascript" src = "testnewadministratoruser.js">
  2.  
  3. </script>
  4.  
I know this is right, however it 's still not catching it. I've shown the code to a couple of Professors at my university and they cant work it out! Any suggestions/thoughts on the matter would be gratefully appreciated!
Jul 27 '07 #1
5 1169
pbmods
5,821 Recognized Expert Expert
Heya, Gillian1985. Welcome to TSDN!

What do you want your code to do? Give an example.
What is your code doing that you don't want it to do? Give an example.
What is your code *not* doing that it is supposed to? Give an example.
Jul 27 '07 #2
Gillian1985
3 New Member
Hi There!

The validation script checks each field and makes sure that the appropriate value has been entered, an error message should appear where each field has been left empty. However even if I leave all the fields empty it adds a blank record to my database. Infuriatingly i've used the exact approach in another part of my site and the JS validation works perfectly! I've checked them both thorougly and the code is the same. Even my professor has no idea whats going on with it!
Jul 27 '07 #3
ak1dnar
1,584 Recognized Expert Top Contributor
I think this is the thing you have to do. to call for a JS script in the same directory.

src="your_jsfile.js" // set the path here

your_jsfile.js

Expand|Select|Wrap|Line Numbers
  1.  function dosomething(){
  2. alert("boom")
  3. }

Html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script language="JavaScript" type="text/javascript" src="your_jsfile.js"></script>
  4. </head>
  5. <body>
  6. <input name="call_js" type="button" value="try it" onclick="dosomething()" />
  7. </body>
  8. </html>
  9.  
Jul 27 '07 #4
Gillian1985
3 New Member
Hi there,

Thanks for your help, amaged to get the script working over the weekend. Will definately keeep using this site.

Gillian
Jul 30 '07 #5
ak1dnar
1,584 Recognized Expert Top Contributor
Hi there,

Thanks for your help, amaged to get the script working over the weekend. Will definately keeep using this site.

Gillian
glad to hear that Gillian, welcome back any time to TSDN.
-ajaxrand
Jul 30 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
21
by: AnnMarie | last post by:
<script language="JavaScript" type="text/javascript"> <!-- function validate(theForm) { var validity = true; // assume valid if(frmComments.name.value=='' && validity == true) { alert('Your...
1
by: Stephen | last post by:
Hey Everyone, I have a problem with a web application due to the use of both client-side and server side script on the on-click event of a button. The client side script runs first as expected...
19
by: Vinod | last post by:
Hi, I have got a peculiar requirement. I want to distinquish between the color codes. I have got two text fields and i will enter the color codes there. The first text field will have ...
7
by: The Directive | last post by:
How do you make your code bulletproof? For example, I make my function bulletproof by validating every argument passed to the function. I ensure the arguments are within the expected ranges. This...
2
by: Tony Williams | last post by:
I have an input form which has a command button called cmdSave. Thre procedure behind this button does 2 things 1. It validates that 2 text controls are completed and 2. Pops up lots of message...
1
by: Stephen | last post by:
Hey Everyone, I have a problem with a web application due to the use of both client-side and server side script on the on-click event of a button. The client side script runs first as expected...
1
by: shapper | last post by:
Hello, I created a Structure as follows: ' Pair Public Structure Pair ' -- ---- ' Expression
8
by: Greg (codepug | last post by:
For lack of the proper expression, how do I excite a control to cause events to trigger. I have a date control and am using a calender form button to fill the text box with the date. The text box...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.