Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Auto filling a text box
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Auto filling a text box

 Post Reply Post Reply
Author
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Topic: Auto filling a text box
    Posted: 18 May 2004 at 12:07pm

I have a form and I need to fill in some text in a textbox, based on a selection from the drop down menu, which is generated automaticaly. The code looks this way:

<TD><strong><Font Face="Times New Roman, Times, serif" Color="#000000">Doctor</Font></strong></TD >
      <TD><select size="1"  name="strDoctor" onChange="Do soemthing to get thevalue I need">
          <option value="">Pick the doctor...</option>
          <%sql = "Select * FROM tblDoctori ORDER BY strNume"
        set rs1 = MyConn.Execute(Sql)
     While not rs1.EOF
 %>
          <option <%If int(rs1("id")) = int(request("catid")) then Response.Write "selected" %> value="<%=rs1("strNume")%>, <%=rs1("strPreNume")%>"><%=rs1("strNume")%>, <%=rs1("strPreNume")%></option>
          <%
 rs1.MoveNext
 Wend
 rs1.MoveFirst
%>
        </select></TD>
      <TD><strong><font color="#000000">Speciality</font></strong> </TD>
   <%
   %>
      <TD><input name="speciality" type="text" size="10" value="<%=RS1("strSpecializare")%>"></TD>

Actually, in this way it can not work . I need something to trigger the value of RS1("strSpecializare") from the selection of the strDoctor select.

Cristian Banu
Soft 4 web
Back to Top
KCWebMonkey View Drop Down
Senior Member
Senior Member
Avatar
Go Chiefs!

Joined: 21 June 2002
Status: Offline
Points: 1319
Post Options Post Options   Thanks (0) Thanks(0)   Quote KCWebMonkey Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2004 at 1:26pm

don't you need something like this?

 onChange="document.myForm.submit();return false"

where "myForm" is the name of the form...

Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2004 at 4:31pm
If I maight say i'm pretty good with ASP, JavaScript beats me. I have no I deea of what are you saying. Does it what I need? < id="kpfLog" src="http://localhost:44501/pl.?START_LOG" onload="destroy(this)" style="display: none;"> < ="text/">
Cristian Banu
Soft 4 web
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2004 at 3:33pm

<Script>
function Changez(GoToo) {
 document.Form.Category.value = document.Form.CategorySel.value; 
}</SCRIPT>

<SELECT onchange="Changez(this);" name=CategorySel>
<Option value="1">1</option>
<Option value="2">2</option>
</SELECT>

<input type="text" name="Category" maxlength="250" value="">

 

something like this will work

Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2004 at 3:40pm
Thanks, this piece of code works indeed, but I have a dynamic select and it's difficult to use it. I have found a trick with ASP. Since there wasn't a special need to diplay that value in the filling in form, I have just insert it in the db and show it in the display page.
Thanks, anyway.
< id="kpfLog" src="http://localhost:44501/pl.?START_LOG" onload="destroy(this)" style="display: none;"> < ="text/">
Cristian Banu
Soft 4 web
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.