Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

JavaScript and recordset fields

Posted on 2009-04-13
3
Medium Priority
?
586 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Developer tools in browsers have been around for a while, yet they are still heavily underused by developers. Developers still fix html or CSS then refresh page to see effect, or they put alert or debugger in JavaScript and then try again and again …
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
This video teaches users how to migrate an existing Wordpress website to a new domain.
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.
Suggested Courses

927 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