Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:

Password:

Remember me

php code in asp
Welcome, Guest. Please login or register.
January 09, 2009, 07:18:42 AM
11313 Posts in 1251 Topics by 508 Members
Latest Member: pissematbox
Experts Round Table Network  |  Serverside Technology  |  ASP  |  php code in asp « previous next »
Pages: 1 [2]
Author Topic: php code in asp  (Read 1419 times)
Johnny26652

Offline Offline

Posts: 61


« Reply #15 on: April 04, 2007, 04:15:04 PM »

http://www.rodsdot.com/ee/dynamicRows2.asp

in the above example is it possible to have select state as the first element instead of displaying state name?

in the insert table

sel.options[0] = new Option('select state' '');

for (var idx=0;idx<csArray.length;idx++) {     
sel.options[idx] = new Option(csArray[idx][0], csArray[idx][1]);     
}

how do i change the  option[0]  value?

also how can i display headers for the table <th> book </th> when creating table dynamically?

thanks
« Last Edit: April 04, 2007, 06:42:08 PM by Johnny26652 » Logged

Johnny
VGR
Mentor

Offline Offline

Posts: 684



WWW
« Reply #16 on: April 06, 2007, 07:06:11 AM »

Code:
[b]
   idx = 1 ' JavaSccript arrays are zero based.
   theArray = theArray & " csArray[0]=(['select state',0]);" & vbLF
[/b]
    ' fill the array from our recordset
    While NOT rs.eof
        theArray = theArray & " csArray["& idx &"]=(['"
        for each item in rs.fields
            theArray = theArray & item & "','"
        next

        ' backoff the trailing ,' and terminate the line with ]);
        theArray = Left(theArray, Len(theArray)-2) & "]);" & vbLF

        ' increment our array index
        idx = idx + 1
        rs.movenext
    Wend

don't forget to change the POST handling in case the user left the index at 0 (= no selection)

I didn't check that element 0 is said " selected"

I'm not sure either I have put all the required values in the []
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
Johnny26652

Offline Offline

Posts: 61


« Reply #17 on: April 06, 2007, 06:14:31 PM »

thanks VGR. any help with headers?  any general function to validate dynamically generated form fields?

thanks again
Logged

Johnny
VGR
Mentor

Offline Offline

Posts: 684



WWW
« Reply #18 on: April 07, 2007, 01:06:53 AM »

for the TH elements, it's a matte of adding a nextElement to the FirstSibling, the way it's done for the TD

for the validation, I suggest to do it on the server in ASP, because your javascript is already complex enough
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
Pages: 1 [2]
« previous next »
    Jump to: