Solved

JavaScript and recordset fields

Posted on 2009-04-13
3
548 Views
Last Modified: 2012-05-06
if (document.getElementById('FormID').value == '{327C805C-BF7A-4541-87E8-33AD24A23F6D}') {
              var myTextField1 = document.getElementById('TCO Career Field');
  alert("Please provide values for all fields.");
              }
I would like to replace
                                    (document.getElementById('FormID').value == '{327C805C-BF7A-4541-87E8-33AD24A23F6D}')

with if (RS("form") = "Test  Memo"

Can I do it by
   if (<%rs("fORM")%> = "Test memo")

This code will be inserted in JavaScrip portion of asp page.


In other words, how can I pass the value of objRS fields to JavaScript
Thanks

0
Comment
Question by:Faye_DBA
  • 2
3 Comments
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 24135955
Hi Faye_DBA,
Yes, you're almost there. You can refer the asp variable inside javascript block.
Here is the example:
eg:
  if ('<%=rs("fORM")%>' = "Test memo")

0
 

Author Comment

by:Faye_DBA
ID: 24137302
Thanks apparantly what I am trying to do is not working because the value of the form equals values of two fields in the table. On the submit form processing this rs("form") causes problems.
Now I have a new question:
What happens to the hidden elements on form submit?

Thanks

0
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 500 total points
ID: 24144363
Hi Faye_DBA,
>>..the value of the form equals values of two fields in the table. On the submit form processing this rs("form") causes problems.
Perhaps you can post the related code snippet here?

>>..Now I have a new question:
What happens to the hidden elements on form submit?
- It's good to clarify all the question in initial first post for better solution. Otherwise, it'll become never ending thread. But, i can assist on this further question if you can give more details about mentioned?

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now