Setting By default value of a particular HTML variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2018 08:27 AM
Hello
I need to set a by default table for a particular HTML variable intended to ease the process oF data entry of the user.
Whenever, this form loads, What is happening filed should by default have the above table in it
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2018 08:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 04:34 AM
HI @SanjivMeher ,
this is not working for me.
function onLoad() {
//Type appropriate comment here, and begin script below
var mySourceCode = '<p><strong>Fill the details below</strong></p>
<table style="border-collapse: collapse; width: 100.957%; height: 153.958px;" border="1">
<tbody>
<tr style="height: 46.1875px;">
<td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor/pricing</span></strong></span></td>
<td style="width: 8.11567%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Initial Price </span></strong></span></td>
<td style="width: 7.19534%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Final Price</span></strong></span></td>
<td style="width: 10.2073%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Savings</span></strong></span></td>
<td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Lowest Bidder</span></strong></span></td>
<td style="width: 17.068%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Recommended bidder</span></strong></span></td>
<td style="width: 19.076%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Reason for recommendation</span></strong></span></td>
<td style="width: 8.45034%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">SAN Active</span></strong></span></td>
<td style="width: 11.1277%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Remarks</span></strong></span></td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor 1</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 2</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 3</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
</tbody>
</table>';
g_form.setValue()
}
function onLoad() {
//Type appropriate comment here, and begin script below
var mySourceCode = '<p><strong>Fill the details below</strong></p>
<table style="border-collapse: collapse; width: 100.957%; height: 153.958px;" border="1">
<tbody>
<tr style="height: 46.1875px;">
<td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor/pricing</span></strong></span></td>
<td style="width: 8.11567%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Initial Price </span></strong></span></td>
<td style="width: 7.19534%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Final Price</span></strong></span></td>
<td style="width: 10.2073%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Savings</span></strong></span></td>
<td style="width: 9.37067%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Lowest Bidder</span></strong></span></td>
<td style="width: 17.068%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Recommended bidder</span></strong></span></td>
<td style="width: 19.076%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Reason for recommendation</span></strong></span></td>
<td style="width: 8.45034%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">SAN Active</span></strong></span></td>
<td style="width: 11.1277%; height: 46.1875px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Remarks</span></strong></span></td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">vendor 1</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 2</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
<tr style="height: 15.3958px;">
<td style="width: 9.37067%; height: 15.3958px;"><span style="background-color: #ffffff;"><strong><span style="color: #000000; font-size: 8pt; background-color: #ffffff;">Vendor 3</span></strong></span></td>
<td style="width: 8.11567%; height: 15.3958px;"> </td>
<td style="width: 7.19534%; height: 15.3958px;"> </td>
<td style="width: 10.2073%; height: 15.3958px;"> </td>
<td style="width: 9.37067%; height: 15.3958px;"> </td>
<td style="width: 17.068%; height: 15.3958px;"> </td>
<td style="width: 19.076%; height: 15.3958px;"> </td>
<td style="width: 8.45034%; height: 15.3958px;"> </td>
<td style="width: 11.1277%; height: 15.3958px;"> </td>
</tr>
</tbody>
</table>';
g_form.setValue('backend_html_var',mySourceCode );
}
While assigning the source code to mySourceCode variable it's throwing error "unterminated string constant".
Can you please help here?