Solved

JavaScript and recordset fields

Posted on 2009-04-13
3
541 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction (All good things must come to an end (http://en.wikipedia.org/wiki/All_Good_Things...)) The original MySQL API (http://php.net/manual/en/book.mysql.php) has gone away, deprecated by PHP in Version 5.5, and removed from PHP in all curre…
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…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

708 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

14 Experts available now in Live!

Get 1:1 Help Now