Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 3rd, 2006, 01:09 PM
Registered User
 
Join Date: Jan 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Inserting data from combo box

 Hi all.
I have a problem and I hope someone can help.

I have two tables

CREATE TABLE manager(
managerID INTEGER NOT NULL, (PK)
groupID INTEGER NOT NULL,
mname VARCHAR2(20),
msurname VARCHAR2(20)NOT NULL,
memail VARCHAR2(50)NOT NULL,
mpassword VARCHAR2(50)NOT NULL);

CREATE TABLE groups(
groupID INTEGER NOT NULL,(PK)
gtype CHAR(15) NOT NULL);

(xstl File linking to xsql file)
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:include href="../-xslt/top_links.xsl" />
<xsl:include href="../-xslt/error.xsl" />
<xsl:template match="add_user">
<html>

<head>
<link rel="stylesheet" type="text/css" href="../-css/logo.css" />
<title>Add User</title>
</head>

<body>
<xsl:call-template name="top_links" />
<form method="POST" actions="add_user.xsql">
<table>
<th>First Name</th><th>Surname</th><th>Email</th><th>Group</th><th>Password</th>
<tr>
<th><input type="text" name="name"
value="" /></th>

<th><input type="text" name="surname"
value="" /></th>

<th><input type="text" name="email"
value="" /></th>

<th><select name="group">
<xsl:apply-templates select="ROWSET/ROW" />
</select></th>

<th><input type="text" name="password"
value="" /></th>
</tr>

</table>
<table cellspacing="20">
<tr>
<input type="submit" value="Add" />
</tr>
</table>
</form>
<tr>
<td><xsl:apply-templates select="//xsql-error" /></td>
</tr>
</body>
</html>
</xsl:template>

<xsl:template match="ROW">
<option>
<xsl:value-of select="." />
</option>
</xsl:template>

</xsl:stylesheet>

(XSQL FILE)
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="../-xslt/add_user.xsl" ?>
<add_user connection="*********" xmlns:xsql="urn:*********">

<xsql:query>
select gtype from GROUPS
</xsql:query>
<xsql:include-request-params />


<xsql:dml bind-params="name surname email group password">
INSERT INTO MANAGER
(mname, msurname, memail, groupID, mpassword)
VALUES
(?,?,?,?,?)
</xsql:dml>

</add_user>

I have an xslt script which is linked to a xsql query which displays gtype in a drop down box. I have a bunch of text boxes to input details to the database. How ever, I need to find a way to look up what has been selected in the drop down box which dislays gtype to put into the insert statement which only accepts the groupID. Would I have to use some kind of trigger of perhaps make another view and insert from there??

Any help would be great..

Regards
Bergs






Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering Data from one Combo Box to another Steve1977 ASP.NET 3.5 Basics 1 September 14th, 2008 08:50 AM
Rebinding a data to combo box zaki79 .NET Framework 1.x 2 April 25th, 2008 04:43 AM
Access Data from a combo box darkhalf Access VBA 1 February 22nd, 2008 04:28 PM
Dynamically change the data on a combo box soc22 Access VBA 2 October 2nd, 2006 08:59 AM
Combo Box - Data In Use MrDannyP Beginning VB 6 1 November 15th, 2003 10:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.