Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-18-2003, 01:00 AM   PM User | #1
ashok_19
New to the CF scene

 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
ashok_19 is an unknown quantity at this point
Compare Dropdown and textbox validation

Hi,
I need my users to choose a value from the dropdown and type the same value on the textbox. This is the code that I am using and getting an error even if I type the same value. HELP please.

<form action="insert_add_prod.asp" method="post" name="add_prod" id="add_prod" OnSubmit="return ValidateFields(this)">

<select name="prod_id" id="prod_id" >
<%
'Execute your Query using MyConnection
Do Until Myrs.eof
%>
<option value="<% = Myrs.Fields("item_id") %> ">
<% = Myrs.Fields("item_id") %>
</option>
<%
'Move to the next record
Myrs.movenext
loop
%>
</select>

Is that a problem? This is the code I am using to validate;

else if(document.add_prod.prod_id.options[document.add_prod.prod_id.selectedIndex].value != document.add_prod.prod_id_chk.value )
{
alert("Please enter same Product ID.");
document.add_prod.prod_id_chk.focus();
return false;

}
ashok_19 is offline   Reply With Quote
Old 10-18-2003, 06:32 AM   PM User | #2
Roelf
Senior Coder

 
Join Date: Jun 2002
Location: Zwolle, The Netherlands
Posts: 1,110
Thanks: 2
Thanked 28 Times in 28 Posts
Roelf is on a distinguished road
Re: Compare Dropdown and textbox validation

Quote:
Originally posted by ashok_19
<option value="<% = Myrs.Fields("item_id") %> ">
your values end with a space this way, is that what you are overseeing?
probably it should be
<option value="<% = Myrs.Fields("item_id") %>">
Roelf is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:25 AM.


Advertisement
Log in to turn off these ads.